Skip to content

Commit d3f63ca

Browse files
committed
2 parents 6a742fe + be9f1b6 commit d3f63ca

File tree

23 files changed

+3337
-1
lines changed

23 files changed

+3337
-1
lines changed

bin/configs/postman-collection.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
generatorName: postman-collection
2+
outputDir: samples/schema/postman-collection
3+
inputSpec: modules/openapi-generator/src/test/resources/3_0/postman-collection/SampleProject.yaml
4+
templateDir: modules/openapi-generator/src/main/resources/postman-collection

docs/generators.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ The following generators are available:
153153
* [graphql-schema](generators/graphql-schema.md)
154154
* [ktorm-schema (beta)](generators/ktorm-schema.md)
155155
* [mysql-schema](generators/mysql-schema.md)
156+
* [postman-collection (beta)](generators/postman-collection.md)
156157
* [protobuf-schema (beta)](generators/protobuf-schema.md)
157158
* [wsdl-schema (beta)](generators/wsdl-schema.md)
158159

docs/generators/postman-collection.md

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
---
2+
title: Documentation for the postman-collection Generator
3+
---
4+
5+
## METADATA
6+
7+
| Property | Value | Notes |
8+
| -------- | ----- | ----- |
9+
| generator name | postman-collection | pass this to the generate command after -g |
10+
| generator stability | BETA | |
11+
| generator type | SCHEMA | |
12+
| generator default templating engine | mustache | |
13+
| helpTxt | Generates a Postman collection (format v2.1.0) JSON file | |
14+
15+
## CONFIG OPTIONS
16+
These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details.
17+
18+
| Option | Description | Values | Default |
19+
| ------ | ----------- | ------ | ------- |
20+
|folderStrategy|whether to create folders according to the spec’s paths or tags| |null|
21+
|pathParamsAsVariables|whether to create Postman variables for path parameters| |false|
22+
|postmanGuid|whether to convert placeholders (i.e. {{UNIQUE_REFERENCE}}) into Postman formula {{$guid}}| |null|
23+
|postmanGuidPlaceholderName|name of the placeholder (i.e. {{UNIQUE_REFERENCE}}) to replace with Postman formula {{$guid}}| |null|
24+
|postmanIsoTimestamp|whether to convert placeholders (i.e. {{ISO_TIMESTAMP}}) into Postman formula {{$isoTimestamp}}| |null|
25+
|postmanIsoTimestampPlaceholderName|name of the placeholder (i.e. {{ISO_TIMESTAMP}}) to replace with Postman formula {{$isoTimestamp}}| |null|
26+
|postmanVariables|whether to convert placeholders (i.e. {{VAR_1}}) into Postman variables| |null|
27+
|requestParameterGeneration|whether to generate the request parameters based on the schema or the examples| |null|
28+
29+
## IMPORT MAPPING
30+
31+
| Type/Alias | Imports |
32+
| ---------- | ------- |
33+
34+
35+
## INSTANTIATION TYPES
36+
37+
| Type/Alias | Instantiated By |
38+
| ---------- | --------------- |
39+
40+
41+
## LANGUAGE PRIMITIVES
42+
43+
<ul class="column-ul">
44+
</ul>
45+
46+
## RESERVED WORDS
47+
48+
<ul class="column-ul">
49+
</ul>
50+
51+
## FEATURE SET
52+
53+
54+
### Client Modification Feature
55+
| Name | Supported | Defined By |
56+
| ---- | --------- | ---------- |
57+
|BasePath|✗|ToolingExtension
58+
|Authorizations|✗|ToolingExtension
59+
|UserAgent|✗|ToolingExtension
60+
|MockServer|✗|ToolingExtension
61+
62+
### Data Type Feature
63+
| Name | Supported | Defined By |
64+
| ---- | --------- | ---------- |
65+
|Custom|✗|OAS2,OAS3
66+
|Int32|✓|OAS2,OAS3
67+
|Int64|✓|OAS2,OAS3
68+
|Float|✓|OAS2,OAS3
69+
|Double|✓|OAS2,OAS3
70+
|Decimal|✓|ToolingExtension
71+
|String|✓|OAS2,OAS3
72+
|Byte|✓|OAS2,OAS3
73+
|Binary|✓|OAS2,OAS3
74+
|Boolean|✓|OAS2,OAS3
75+
|Date|✓|OAS2,OAS3
76+
|DateTime|✓|OAS2,OAS3
77+
|Password|✓|OAS2,OAS3
78+
|File|✓|OAS2
79+
|Uuid||
80+
|Array|✓|OAS2,OAS3
81+
|Null|✗|OAS3
82+
|AnyType|✗|OAS2,OAS3
83+
|Object|✓|OAS2,OAS3
84+
|Maps|✓|ToolingExtension
85+
|CollectionFormat|✓|OAS2
86+
|CollectionFormatMulti|✓|OAS2
87+
|Enum|✓|OAS2,OAS3
88+
|ArrayOfEnum|✓|ToolingExtension
89+
|ArrayOfModel|✓|ToolingExtension
90+
|ArrayOfCollectionOfPrimitives|✓|ToolingExtension
91+
|ArrayOfCollectionOfModel|✓|ToolingExtension
92+
|ArrayOfCollectionOfEnum|✓|ToolingExtension
93+
|MapOfEnum|✓|ToolingExtension
94+
|MapOfModel|✓|ToolingExtension
95+
|MapOfCollectionOfPrimitives|✓|ToolingExtension
96+
|MapOfCollectionOfModel|✓|ToolingExtension
97+
|MapOfCollectionOfEnum|✓|ToolingExtension
98+
99+
### Documentation Feature
100+
| Name | Supported | Defined By |
101+
| ---- | --------- | ---------- |
102+
|Readme|✗|ToolingExtension
103+
|Model|✓|ToolingExtension
104+
|Api|✓|ToolingExtension
105+
106+
### Global Feature
107+
| Name | Supported | Defined By |
108+
| ---- | --------- | ---------- |
109+
|Host|✓|OAS2,OAS3
110+
|BasePath|✓|OAS2,OAS3
111+
|Info|✓|OAS2,OAS3
112+
|Schemes|✗|OAS2,OAS3
113+
|PartialSchemes|✓|OAS2,OAS3
114+
|Consumes|✓|OAS2
115+
|Produces|✓|OAS2
116+
|ExternalDocumentation|✓|OAS2,OAS3
117+
|Examples|✓|OAS2,OAS3
118+
|XMLStructureDefinitions|✗|OAS2,OAS3
119+
|MultiServer|✗|OAS3
120+
|ParameterizedServer|✗|OAS3
121+
|ParameterStyling|✗|OAS3
122+
|Callbacks|✓|OAS3
123+
|LinkObjects|✗|OAS3
124+
125+
### Parameter Feature
126+
| Name | Supported | Defined By |
127+
| ---- | --------- | ---------- |
128+
|Path|✓|OAS2,OAS3
129+
|Query|✓|OAS2,OAS3
130+
|Header|✓|OAS2,OAS3
131+
|Body|✓|OAS2
132+
|FormUnencoded|✓|OAS2
133+
|FormMultipart|✓|OAS2
134+
|Cookie|✓|OAS3
135+
136+
### Schema Support Feature
137+
| Name | Supported | Defined By |
138+
| ---- | --------- | ---------- |
139+
|Simple|✓|OAS2,OAS3
140+
|Composite|✓|OAS2,OAS3
141+
|Polymorphism|✓|OAS2,OAS3
142+
|Union|✗|OAS3
143+
|allOf|✗|OAS2,OAS3
144+
|anyOf|✗|OAS3
145+
|oneOf|✗|OAS3
146+
|not|✗|OAS3
147+
148+
### Security Feature
149+
| Name | Supported | Defined By |
150+
| ---- | --------- | ---------- |
151+
|BasicAuth|✓|OAS2,OAS3
152+
|ApiKey|✓|OAS2,OAS3
153+
|OpenIDConnect|✓|OAS3
154+
|BearerToken|✓|OAS3
155+
|OAuth2_Implicit|✓|OAS2,OAS3
156+
|OAuth2_Password|✓|OAS2,OAS3
157+
|OAuth2_ClientCredentials|✓|OAS2,OAS3
158+
|OAuth2_AuthorizationCode|✓|OAS2,OAS3
159+
160+
### Wire Format Feature
161+
| Name | Supported | Defined By |
162+
| ---- | --------- | ---------- |
163+
|JSON|✓|OAS2,OAS3
164+
|XML|✓|OAS2,OAS3
165+
|PROTOBUF|✗|ToolingExtension
166+
|Custom|✗|OAS2,OAS3

docs/generators/postman.md

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
---
2+
title: Documentation for the postman Generator
3+
---
4+
5+
## METADATA
6+
7+
| Property | Value | Notes |
8+
| -------- | ----- | ----- |
9+
| generator name | postman | pass this to the generate command after -g |
10+
| generator stability | BETA | |
11+
| generator type | DOCUMENTATION | |
12+
| generator default templating engine | mustache | |
13+
| helpTxt | Generates a postman JSON file | |
14+
15+
## CONFIG OPTIONS
16+
These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details.
17+
18+
| Option | Description | Values | Default |
19+
| ------ | ----------- | ------ | ------- |
20+
|folderStrategy|whether to create folders according to the spec&rsquo;s paths or tags| |null|
21+
|pathParamsAsVariables|whether to create Postman variables for path parameters| |false|
22+
|postmanGuid|whether to convert placeholders (i.e. {{UNIQUE_REFERENCE}}) into Postman formula {{$guid}}| |null|
23+
|postmanGuidPlaceholderName|name of the placeholder (i.e. {{UNIQUE_REFERENCE}}) to replace with Postman formula {{$guid}}| |null|
24+
|postmanIsoTimestamp|whether to convert placeholders (i.e. {{ISO_TIMESTAMP}}) into Postman formula {{$isoTimestamp}}| |null|
25+
|postmanIsoTimestampPlaceholderName|name of the placeholder (i.e. {{ISO_TIMESTAMP}}) to replace with Postman formula {{$isoTimestamp}}| |null|
26+
|postmanVariables|whether to convert placeholders (i.e. {{VAR_1}}) into Postman variables| |null|
27+
|requestParameterGeneration|whether to generate the request parameters based on the schema or the examples| |null|
28+
29+
## IMPORT MAPPING
30+
31+
| Type/Alias | Imports |
32+
| ---------- | ------- |
33+
34+
35+
## INSTANTIATION TYPES
36+
37+
| Type/Alias | Instantiated By |
38+
| ---------- | --------------- |
39+
40+
41+
## LANGUAGE PRIMITIVES
42+
43+
<ul class="column-ul">
44+
</ul>
45+
46+
## RESERVED WORDS
47+
48+
<ul class="column-ul">
49+
</ul>
50+
51+
## FEATURE SET
52+
53+
54+
### Client Modification Feature
55+
| Name | Supported | Defined By |
56+
| ---- | --------- | ---------- |
57+
|BasePath|✗|ToolingExtension
58+
|Authorizations|✗|ToolingExtension
59+
|UserAgent|✗|ToolingExtension
60+
|MockServer|✗|ToolingExtension
61+
62+
### Data Type Feature
63+
| Name | Supported | Defined By |
64+
| ---- | --------- | ---------- |
65+
|Custom|✗|OAS2,OAS3
66+
|Int32|✓|OAS2,OAS3
67+
|Int64|✓|OAS2,OAS3
68+
|Float|✓|OAS2,OAS3
69+
|Double|✓|OAS2,OAS3
70+
|Decimal|✓|ToolingExtension
71+
|String|✓|OAS2,OAS3
72+
|Byte|✓|OAS2,OAS3
73+
|Binary|✓|OAS2,OAS3
74+
|Boolean|✓|OAS2,OAS3
75+
|Date|✓|OAS2,OAS3
76+
|DateTime|✓|OAS2,OAS3
77+
|Password|✓|OAS2,OAS3
78+
|File|✓|OAS2
79+
|Uuid||
80+
|Array|✓|OAS2,OAS3
81+
|Null|✗|OAS3
82+
|AnyType|✗|OAS2,OAS3
83+
|Object|✓|OAS2,OAS3
84+
|Maps|✓|ToolingExtension
85+
|CollectionFormat|✓|OAS2
86+
|CollectionFormatMulti|✓|OAS2
87+
|Enum|✓|OAS2,OAS3
88+
|ArrayOfEnum|✓|ToolingExtension
89+
|ArrayOfModel|✓|ToolingExtension
90+
|ArrayOfCollectionOfPrimitives|✓|ToolingExtension
91+
|ArrayOfCollectionOfModel|✓|ToolingExtension
92+
|ArrayOfCollectionOfEnum|✓|ToolingExtension
93+
|MapOfEnum|✓|ToolingExtension
94+
|MapOfModel|✓|ToolingExtension
95+
|MapOfCollectionOfPrimitives|✓|ToolingExtension
96+
|MapOfCollectionOfModel|✓|ToolingExtension
97+
|MapOfCollectionOfEnum|✓|ToolingExtension
98+
99+
### Documentation Feature
100+
| Name | Supported | Defined By |
101+
| ---- | --------- | ---------- |
102+
|Readme|✗|ToolingExtension
103+
|Model|✓|ToolingExtension
104+
|Api|✓|ToolingExtension
105+
106+
### Global Feature
107+
| Name | Supported | Defined By |
108+
| ---- | --------- | ---------- |
109+
|Host|✓|OAS2,OAS3
110+
|BasePath|✓|OAS2,OAS3
111+
|Info|✓|OAS2,OAS3
112+
|Schemes|✗|OAS2,OAS3
113+
|PartialSchemes|✓|OAS2,OAS3
114+
|Consumes|✓|OAS2
115+
|Produces|✓|OAS2
116+
|ExternalDocumentation|✓|OAS2,OAS3
117+
|Examples|✓|OAS2,OAS3
118+
|XMLStructureDefinitions|✗|OAS2,OAS3
119+
|MultiServer|✗|OAS3
120+
|ParameterizedServer|✗|OAS3
121+
|ParameterStyling|✗|OAS3
122+
|Callbacks|✓|OAS3
123+
|LinkObjects|✗|OAS3
124+
125+
### Parameter Feature
126+
| Name | Supported | Defined By |
127+
| ---- | --------- | ---------- |
128+
|Path|✓|OAS2,OAS3
129+
|Query|✓|OAS2,OAS3
130+
|Header|✓|OAS2,OAS3
131+
|Body|✓|OAS2
132+
|FormUnencoded|✓|OAS2
133+
|FormMultipart|✓|OAS2
134+
|Cookie|✓|OAS3
135+
136+
### Schema Support Feature
137+
| Name | Supported | Defined By |
138+
| ---- | --------- | ---------- |
139+
|Simple|✓|OAS2,OAS3
140+
|Composite|✓|OAS2,OAS3
141+
|Polymorphism|✓|OAS2,OAS3
142+
|Union|✗|OAS3
143+
|allOf|✗|OAS2,OAS3
144+
|anyOf|✗|OAS3
145+
|oneOf|✗|OAS3
146+
|not|✗|OAS3
147+
148+
### Security Feature
149+
| Name | Supported | Defined By |
150+
| ---- | --------- | ---------- |
151+
|BasicAuth|✓|OAS2,OAS3
152+
|ApiKey|✓|OAS2,OAS3
153+
|OpenIDConnect|✗|OAS3
154+
|BearerToken|✓|OAS3
155+
|OAuth2_Implicit|✓|OAS2,OAS3
156+
|OAuth2_Password|✓|OAS2,OAS3
157+
|OAuth2_ClientCredentials|✓|OAS2,OAS3
158+
|OAuth2_AuthorizationCode|✓|OAS2,OAS3
159+
160+
### Wire Format Feature
161+
| Name | Supported | Defined By |
162+
| ---- | --------- | ---------- |
163+
|JSON|✓|OAS2,OAS3
164+
|XML|✓|OAS2,OAS3
165+
|PROTOBUF|✗|ToolingExtension
166+
|Custom|✗|OAS2,OAS3

modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ private Boolean getGeneratorPropertyDefaultSwitch(final String key, final Boolea
203203
void configureGeneratorProperties() {
204204
// allows generating only models by specifying a CSV of models to generate, or empty for all
205205
// NOTE: Boolean.TRUE is required below rather than `true` because of JVM boxing constraints and type inference.
206-
generateApis = GlobalSettings.getProperty(CodegenConstants.APIS) != null ? Boolean.TRUE : getGeneratorPropertyDefaultSwitch(CodegenConstants.APIS, null);
206+
generateApis = GlobalSettings.getProperty(CodegenConstants.APIS) != null ? Boolean.valueOf(GlobalSettings.getProperty(CodegenConstants.APIS)) : getGeneratorPropertyDefaultSwitch(CodegenConstants.APIS, null);
207207
generateModels = GlobalSettings.getProperty(CodegenConstants.MODELS) != null ? Boolean.TRUE : getGeneratorPropertyDefaultSwitch(CodegenConstants.MODELS, null);
208208
generateSupportingFiles = GlobalSettings.getProperty(CodegenConstants.SUPPORTING_FILES) != null ? Boolean.TRUE : getGeneratorPropertyDefaultSwitch(CodegenConstants.SUPPORTING_FILES, null);
209209

0 commit comments

Comments
 (0)