Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

Commit 016bd0d

Browse files
authored
v2 readme adds usage notes (#144)
* Adds usage section * Adds Json Schema Type Object section * Adds todos * Adds another invalid variable * Adds details sections to readme * Small readme improvements * Samples updated * Adds Schema default feature
1 parent fa5b24c commit 016bd0d

19 files changed

Lines changed: 687 additions & 56 deletions

File tree

docs/generators/java.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
308308
|AdditionalProperties|✗|OAS2,OAS3
309309
|AllOf|✗|OAS2,OAS3
310310
|AnyOf|✗|OAS3
311+
|Default|✗|OAS2,OAS3
311312
|Discriminator|✓|OAS2,OAS3
312313
|Enum|✓|OAS2,OAS3
313314
|ExclusiveMinimum|✓|OAS2,OAS3

docs/generators/jaxrs-jersey.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
291291
|AdditionalProperties|✗|OAS2,OAS3
292292
|AllOf|✗|OAS2,OAS3
293293
|AnyOf|✗|OAS3
294+
|Default|✗|OAS2,OAS3
294295
|Discriminator|✓|OAS2,OAS3
295296
|Enum|✓|OAS2,OAS3
296297
|ExclusiveMinimum|✓|OAS2,OAS3

docs/generators/jmeter.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
150150
|AdditionalProperties|✗|OAS2,OAS3
151151
|AllOf|✗|OAS2,OAS3
152152
|AnyOf|✗|OAS3
153+
|Default|✗|OAS2,OAS3
153154
|Discriminator|✓|OAS2,OAS3
154155
|Enum|✓|OAS2,OAS3
155156
|ExclusiveMinimum|✓|OAS2,OAS3

docs/generators/kotlin.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
260260
|AdditionalProperties|✗|OAS2,OAS3
261261
|AllOf|✗|OAS2,OAS3
262262
|AnyOf|✗|OAS3
263+
|Default|✗|OAS2,OAS3
263264
|Discriminator|✓|OAS2,OAS3
264265
|Enum|✓|OAS2,OAS3
265266
|ExclusiveMinimum|✓|OAS2,OAS3

docs/generators/python.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
219219
|AdditionalProperties|✓|OAS2,OAS3
220220
|AllOf|✓|OAS2,OAS3
221221
|AnyOf|✓|OAS3
222+
|Default|✓|OAS2,OAS3
222223
|Discriminator|✓|OAS2,OAS3
223224
|Enum|✓|OAS2,OAS3
224225
|ExclusiveMinimum|✓|OAS2,OAS3

modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/FeatureSet.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ public Builder excludeDocumentationFeatures(DocumentationFeature... documentatio
524524
* @param schemaFeatures the {@code schemaSupportFeature} to set
525525
* @return a reference to this Builder
526526
*/
527-
public Builder schemaSupportFeatures(EnumSet<SchemaFeature> schemaFeatures) {
527+
public Builder schemaFeatures(EnumSet<SchemaFeature> schemaFeatures) {
528528
if (schemaFeatures != null) {
529529
this.schemaFeatures = schemaFeatures;
530530
} else {
@@ -540,7 +540,7 @@ public Builder schemaSupportFeatures(EnumSet<SchemaFeature> schemaFeatures) {
540540
*
541541
* @return a reference to this Builder
542542
*/
543-
public Builder includeSchemaSupportFeatures(SchemaFeature... schemaFeature) {
543+
public Builder includeSchemaFeatures(SchemaFeature... schemaFeature) {
544544
this.schemaFeatures.addAll(Arrays.stream(schemaFeature).collect(Collectors.toList()));
545545
return this;
546546
}
@@ -552,7 +552,7 @@ public Builder includeSchemaSupportFeatures(SchemaFeature... schemaFeature) {
552552
*
553553
* @return a reference to this Builder
554554
*/
555-
public Builder excludeSchemaSupportFeatures(SchemaFeature... schemaFeature) {
555+
public Builder excludeSchemaFeatures(SchemaFeature... schemaFeature) {
556556
this.schemaFeatures.removeAll(Arrays.stream(schemaFeature).collect(Collectors.toList()));
557557
return this;
558558
}

modules/openapi-json-schema-generator-core/src/main/java/org/openapijsonschematools/codegen/meta/features/SchemaFeature.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ public enum SchemaFeature {
4040
@OAS3
4141
AnyOf,
4242

43+
@OAS2 @OAS3
44+
Default,
45+
4346
@OAS2 @OAS3
4447
Discriminator,
4548

modules/openapi-json-schema-generator-core/src/test/java/org/openapijsonschematools/codegen/meta/FeatureSetTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public void flattenOnMultipleFeatures() {
4444
.includeParameterFeatures(ParameterFeature.In_Header, ParameterFeature.In_Query)
4545
.includeSecurityFeatures(SecurityFeature.HTTP_Bearer, SecurityFeature.HTTP_Basic, SecurityFeature.OAuth2_Implicit)
4646
.includeDocumentationFeatures(DocumentationFeature.ComponentSchemas)
47-
.includeSchemaSupportFeatures(SchemaFeature.OneOf)
47+
.includeSchemaFeatures(SchemaFeature.OneOf)
4848
.build();
4949

5050
List<FeatureSet.FeatureSetFlattened> flattened = featureSet.flatten();

modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/DefaultCodegen.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public class DefaultCodegen implements CodegenConfig {
142142
GlobalFeature.Info,
143143
GlobalFeature.Components
144144
)
145-
.includeSchemaSupportFeatures(
145+
.includeSchemaFeatures(
146146
SchemaFeature.Discriminator, SchemaFeature.Enum,
147147
SchemaFeature.ExclusiveMaximum, SchemaFeature.ExclusiveMinimum,
148148
SchemaFeature.Format, SchemaFeature.Items,

modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/AbstractJavaCodegen.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public AbstractJavaCodegen() {
135135
.securityFeatures(EnumSet.noneOf(
136136
SecurityFeature.class
137137
))
138-
.excludeSchemaSupportFeatures(
138+
.excludeSchemaFeatures(
139139
SchemaFeature.Not
140140
)
141141
.includeClientModificationFeatures(

0 commit comments

Comments
 (0)