Skip to content

Commit 398bcd6

Browse files
feat: make custom accept header is created in appInner.mustache
1 parent a7240ee commit 398bcd6

File tree

49 files changed

+3561
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+3561
-0
lines changed

modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,9 @@ export const {{classname}}AxiosParamCreator = function (configuration?: Configur
196196
{{/consumes.0}}
197197
198198
{{/bodyParam}}
199+
{{#hasProduces}}
200+
localVarHeaderParameter['Accept'] = {{#produces}}'{{{mediaType}}}'{{^-last}}; {{/-last}}{{/produces}};
201+
{{/hasProduces}}
199202
{{#headerParams}}
200203
{{#isArray}}
201204
if ({{paramName}}) {
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
3+
# AllOfRefToDouble
4+
5+
Object with allOf ref to double
6+
7+
## Properties
8+
9+
| Name | Type | Description | Notes |
10+
|------------ | ------------- | ------------- | -------------|
11+
|**height** | **Double** | Height as double | [optional] |
12+
13+
14+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
3+
# AllOfRefToFloat
4+
5+
Object with allOf ref to float
6+
7+
## Properties
8+
9+
| Name | Type | Description | Notes |
10+
|------------ | ------------- | ------------- | -------------|
11+
|**weight** | **Float** | Weight as float | [optional] |
12+
13+
14+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
3+
# AllOfRefToLong
4+
5+
Object with allOf ref to long
6+
7+
## Properties
8+
9+
| Name | Type | Description | Notes |
10+
|------------ | ------------- | ------------- | -------------|
11+
|**id** | **Long** | Id as long | [optional] |
12+
13+
14+
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
/*
2+
* OpenAPI Petstore
3+
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
4+
*
5+
* The version of the OpenAPI document: 1.0.0
6+
*
7+
*
8+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9+
* https://openapi-generator.tech
10+
* Do not edit the class manually.
11+
*/
12+
13+
14+
package org.openapitools.client.model;
15+
16+
import org.apache.commons.lang3.builder.EqualsBuilder;
17+
import org.apache.commons.lang3.builder.HashCodeBuilder;
18+
import java.util.Objects;
19+
import java.util.Map;
20+
import java.util.HashMap;
21+
import java.util.Locale;
22+
import com.fasterxml.jackson.annotation.JsonInclude;
23+
import com.fasterxml.jackson.annotation.JsonProperty;
24+
import com.fasterxml.jackson.annotation.JsonCreator;
25+
import com.fasterxml.jackson.annotation.JsonTypeName;
26+
import com.fasterxml.jackson.annotation.JsonValue;
27+
import java.util.Arrays;
28+
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
29+
import jakarta.validation.constraints.*;
30+
import jakarta.validation.Valid;
31+
import org.openapitools.client.JSON;
32+
33+
34+
/**
35+
* Object with allOf ref to double
36+
*/
37+
@JsonPropertyOrder({
38+
AllOfRefToDouble.JSON_PROPERTY_HEIGHT
39+
})
40+
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.18.0-SNAPSHOT")
41+
public class AllOfRefToDouble {
42+
public static final String JSON_PROPERTY_HEIGHT = "height";
43+
@jakarta.annotation.Nullable
44+
private Double height = 32.1d;
45+
46+
public AllOfRefToDouble() {
47+
}
48+
49+
public AllOfRefToDouble height(@jakarta.annotation.Nullable Double height) {
50+
this.height = height;
51+
return this;
52+
}
53+
54+
/**
55+
* Height as double
56+
* @return height
57+
*/
58+
@jakarta.annotation.Nullable
59+
60+
@JsonProperty(value = JSON_PROPERTY_HEIGHT, required = false)
61+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
62+
63+
public Double getHeight() {
64+
return height;
65+
}
66+
67+
68+
@JsonProperty(value = JSON_PROPERTY_HEIGHT, required = false)
69+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
70+
public void setHeight(@jakarta.annotation.Nullable Double height) {
71+
this.height = height;
72+
}
73+
74+
75+
/**
76+
* Return true if this AllOfRefToDouble object is equal to o.
77+
*/
78+
@Override
79+
public boolean equals(Object o) {
80+
return EqualsBuilder.reflectionEquals(this, o, false, null, true);
81+
}
82+
83+
@Override
84+
public int hashCode() {
85+
return HashCodeBuilder.reflectionHashCode(this);
86+
}
87+
88+
@Override
89+
public String toString() {
90+
StringBuilder sb = new StringBuilder();
91+
sb.append("class AllOfRefToDouble {\n");
92+
sb.append(" height: ").append(toIndentedString(height)).append("\n");
93+
sb.append("}");
94+
return sb.toString();
95+
}
96+
97+
/**
98+
* Convert the given object to string with each line indented by 4 spaces
99+
* (except the first line).
100+
*/
101+
private String toIndentedString(Object o) {
102+
if (o == null) {
103+
return "null";
104+
}
105+
return o.toString().replace("\n", "\n ");
106+
}
107+
108+
}
109+
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
/*
2+
* OpenAPI Petstore
3+
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
4+
*
5+
* The version of the OpenAPI document: 1.0.0
6+
*
7+
*
8+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9+
* https://openapi-generator.tech
10+
* Do not edit the class manually.
11+
*/
12+
13+
14+
package org.openapitools.client.model;
15+
16+
import org.apache.commons.lang3.builder.EqualsBuilder;
17+
import org.apache.commons.lang3.builder.HashCodeBuilder;
18+
import java.util.Objects;
19+
import java.util.Map;
20+
import java.util.HashMap;
21+
import java.util.Locale;
22+
import com.fasterxml.jackson.annotation.JsonInclude;
23+
import com.fasterxml.jackson.annotation.JsonProperty;
24+
import com.fasterxml.jackson.annotation.JsonCreator;
25+
import com.fasterxml.jackson.annotation.JsonTypeName;
26+
import com.fasterxml.jackson.annotation.JsonValue;
27+
import java.util.Arrays;
28+
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
29+
import jakarta.validation.constraints.*;
30+
import jakarta.validation.Valid;
31+
import org.openapitools.client.JSON;
32+
33+
34+
/**
35+
* Object with allOf ref to float
36+
*/
37+
@JsonPropertyOrder({
38+
AllOfRefToFloat.JSON_PROPERTY_WEIGHT
39+
})
40+
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.18.0-SNAPSHOT")
41+
public class AllOfRefToFloat {
42+
public static final String JSON_PROPERTY_WEIGHT = "weight";
43+
@jakarta.annotation.Nullable
44+
private Float weight = 7.89f;
45+
46+
public AllOfRefToFloat() {
47+
}
48+
49+
public AllOfRefToFloat weight(@jakarta.annotation.Nullable Float weight) {
50+
this.weight = weight;
51+
return this;
52+
}
53+
54+
/**
55+
* Weight as float
56+
* @return weight
57+
*/
58+
@jakarta.annotation.Nullable
59+
60+
@JsonProperty(value = JSON_PROPERTY_WEIGHT, required = false)
61+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
62+
63+
public Float getWeight() {
64+
return weight;
65+
}
66+
67+
68+
@JsonProperty(value = JSON_PROPERTY_WEIGHT, required = false)
69+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
70+
public void setWeight(@jakarta.annotation.Nullable Float weight) {
71+
this.weight = weight;
72+
}
73+
74+
75+
/**
76+
* Return true if this AllOfRefToFloat object is equal to o.
77+
*/
78+
@Override
79+
public boolean equals(Object o) {
80+
return EqualsBuilder.reflectionEquals(this, o, false, null, true);
81+
}
82+
83+
@Override
84+
public int hashCode() {
85+
return HashCodeBuilder.reflectionHashCode(this);
86+
}
87+
88+
@Override
89+
public String toString() {
90+
StringBuilder sb = new StringBuilder();
91+
sb.append("class AllOfRefToFloat {\n");
92+
sb.append(" weight: ").append(toIndentedString(weight)).append("\n");
93+
sb.append("}");
94+
return sb.toString();
95+
}
96+
97+
/**
98+
* Convert the given object to string with each line indented by 4 spaces
99+
* (except the first line).
100+
*/
101+
private String toIndentedString(Object o) {
102+
if (o == null) {
103+
return "null";
104+
}
105+
return o.toString().replace("\n", "\n ");
106+
}
107+
108+
}
109+
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
/*
2+
* OpenAPI Petstore
3+
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
4+
*
5+
* The version of the OpenAPI document: 1.0.0
6+
*
7+
*
8+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9+
* https://openapi-generator.tech
10+
* Do not edit the class manually.
11+
*/
12+
13+
14+
package org.openapitools.client.model;
15+
16+
import org.apache.commons.lang3.builder.EqualsBuilder;
17+
import org.apache.commons.lang3.builder.HashCodeBuilder;
18+
import java.util.Objects;
19+
import java.util.Map;
20+
import java.util.HashMap;
21+
import java.util.Locale;
22+
import com.fasterxml.jackson.annotation.JsonInclude;
23+
import com.fasterxml.jackson.annotation.JsonProperty;
24+
import com.fasterxml.jackson.annotation.JsonCreator;
25+
import com.fasterxml.jackson.annotation.JsonTypeName;
26+
import com.fasterxml.jackson.annotation.JsonValue;
27+
import java.util.Arrays;
28+
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
29+
import jakarta.validation.constraints.*;
30+
import jakarta.validation.Valid;
31+
import org.openapitools.client.JSON;
32+
33+
34+
/**
35+
* Object with allOf ref to long
36+
*/
37+
@JsonPropertyOrder({
38+
AllOfRefToLong.JSON_PROPERTY_ID
39+
})
40+
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.18.0-SNAPSHOT")
41+
public class AllOfRefToLong {
42+
public static final String JSON_PROPERTY_ID = "id";
43+
@jakarta.annotation.Nullable
44+
private Long id = 10l;
45+
46+
public AllOfRefToLong() {
47+
}
48+
49+
public AllOfRefToLong id(@jakarta.annotation.Nullable Long id) {
50+
this.id = id;
51+
return this;
52+
}
53+
54+
/**
55+
* Id as long
56+
* @return id
57+
*/
58+
@jakarta.annotation.Nullable
59+
60+
@JsonProperty(value = JSON_PROPERTY_ID, required = false)
61+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
62+
63+
public Long getId() {
64+
return id;
65+
}
66+
67+
68+
@JsonProperty(value = JSON_PROPERTY_ID, required = false)
69+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
70+
public void setId(@jakarta.annotation.Nullable Long id) {
71+
this.id = id;
72+
}
73+
74+
75+
/**
76+
* Return true if this AllOfRefToLong object is equal to o.
77+
*/
78+
@Override
79+
public boolean equals(Object o) {
80+
return EqualsBuilder.reflectionEquals(this, o, false, null, true);
81+
}
82+
83+
@Override
84+
public int hashCode() {
85+
return HashCodeBuilder.reflectionHashCode(this);
86+
}
87+
88+
@Override
89+
public String toString() {
90+
StringBuilder sb = new StringBuilder();
91+
sb.append("class AllOfRefToLong {\n");
92+
sb.append(" id: ").append(toIndentedString(id)).append("\n");
93+
sb.append("}");
94+
return sb.toString();
95+
}
96+
97+
/**
98+
* Convert the given object to string with each line indented by 4 spaces
99+
* (except the first line).
100+
*/
101+
private String toIndentedString(Object o) {
102+
if (o == null) {
103+
return "null";
104+
}
105+
return o.toString().replace("\n", "\n ");
106+
}
107+
108+
}
109+

0 commit comments

Comments
 (0)