Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/generators/java.md
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|PrefixItems|✗|OAS3
|Properties|✓|OAS2,OAS3
|PropertyNames|✗|OAS3
|Ref|✓|OAS2,OAS3
|Required|✓|OAS2,OAS3
|Then|✗|OAS3
|Type|✓|OAS2,OAS3
Expand Down
1 change: 1 addition & 0 deletions docs/generators/jaxrs-jersey.md
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|PrefixItems|✗|OAS3
|Properties|✓|OAS2,OAS3
|PropertyNames|✗|OAS3
|Ref|✗|OAS2,OAS3
|Required|✓|OAS2,OAS3
|Then|✗|OAS3
|Type|✓|OAS2,OAS3
Expand Down
1 change: 1 addition & 0 deletions docs/generators/jmeter.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|PrefixItems|✗|OAS3
|Properties|✓|OAS2,OAS3
|PropertyNames|✗|OAS3
|Ref|✗|OAS2,OAS3
|Required|✓|OAS2,OAS3
|Then|✗|OAS3
|Type|✓|OAS2,OAS3
Expand Down
1 change: 1 addition & 0 deletions docs/generators/kotlin.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|PrefixItems|✗|OAS3
|Properties|✓|OAS2,OAS3
|PropertyNames|✗|OAS3
|Ref|✗|OAS2,OAS3
|Required|✓|OAS2,OAS3
|Then|✗|OAS3
|Type|✓|OAS2,OAS3
Expand Down
1 change: 1 addition & 0 deletions docs/generators/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|PrefixItems|✓|OAS3
|Properties|✓|OAS2,OAS3
|PropertyNames|✓|OAS3
|Ref|✓|OAS2,OAS3
|Required|✓|OAS2,OAS3
|Then|✓|OAS3
|Type|✓|OAS2,OAS3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,27 @@ public class AdditionalProperties extends NotAnyTypeJsonSchema {}
// NotAnyTypeSchema


public static class HeadersMap extends FrozenMap<String, Object> {
HeadersMap(FrozenMap<? extends String, ?> m) {
public static class HeadersMap extends FrozenMap<String, String> {

HeadersMap(FrozenMap<String, String> m) {

super(m);
}
public static HeadersMap of(Map<String, Object> arg, SchemaConfiguration configuration) {
public static final Set<String> requiredKeys = Set.of();
public static final Set<String> optionalKeys = Set.of(
"location"
);
public static HeadersMap of(Map<String, String> arg, SchemaConfiguration configuration) {

return Headers1.validate(arg, configuration);
}

public String location() {

String key = "location";
throwIfKeyNotPresent(key);
return get(key);
}
}

public class Headers1 extends JsonSchema {
Expand All @@ -40,10 +54,12 @@ public class Headers1 extends JsonSchema {
))),
new KeywordEntry("additionalProperties", new AdditionalPropertiesValidator(AdditionalProperties.class))
));
protected static HeadersMap getMapOutputInstance(FrozenMap<? extends String, ?> arg) {
protected static HeadersMap getMapOutputInstance(FrozenMap<String, String> arg) {

return new HeadersMap(arg);
}
public static HeadersMap validate(Map<String, Object> arg, SchemaConfiguration configuration) {
public static HeadersMap validate(Map<String, String> arg, SchemaConfiguration configuration) {

return JsonSchema.validate(Headers1.class, arg, configuration);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,27 @@ public class AdditionalProperties extends NotAnyTypeJsonSchema {}
// NotAnyTypeSchema


public static class HeadersMap extends FrozenMap<String, Object> {
HeadersMap(FrozenMap<? extends String, ?> m) {
public static class HeadersMap extends FrozenMap<String, String> {

HeadersMap(FrozenMap<String, String> m) {

super(m);
}
public static HeadersMap of(Map<String, Object> arg, SchemaConfiguration configuration) {
public static final Set<String> requiredKeys = Set.of();
public static final Set<String> optionalKeys = Set.of(
"someHeader"
);
public static HeadersMap of(Map<String, String> arg, SchemaConfiguration configuration) {

return Headers1.validate(arg, configuration);
}

public String someHeader() {

String key = "someHeader";
throwIfKeyNotPresent(key);
return get(key);
}
}

public class Headers1 extends JsonSchema {
Expand All @@ -40,10 +54,12 @@ public class Headers1 extends JsonSchema {
))),
new KeywordEntry("additionalProperties", new AdditionalPropertiesValidator(AdditionalProperties.class))
));
protected static HeadersMap getMapOutputInstance(FrozenMap<? extends String, ?> arg) {
protected static HeadersMap getMapOutputInstance(FrozenMap<String, String> arg) {

return new HeadersMap(arg);
}
public static HeadersMap validate(Map<String, Object> arg, SchemaConfiguration configuration) {
public static HeadersMap validate(Map<String, String> arg, SchemaConfiguration configuration) {

return JsonSchema.validate(Headers1.class, arg, configuration);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,37 @@ public class Schema {
public class AdditionalProperties extends Int32JsonSchema {}


public static class SchemaMap extends FrozenMap<String, Object> {
SchemaMap(FrozenMap<? extends String, ?> m) {
public static class SchemaMap extends FrozenMap<String, Integer> {

SchemaMap(FrozenMap<String, Integer> m) {

super(m);
}
public static SchemaMap of(Map<String, Object> arg, SchemaConfiguration configuration) {
public static final Set<String> requiredKeys = Set.of();
public static final Set<String> optionalKeys = Set.of();
public static SchemaMap of(Map<String, Integer> arg, SchemaConfiguration configuration) {

return Schema1.validate(arg, configuration);
}

public int getAdditionalProperty(String name) {

throwIfKeyNotPresent(name);
return get(name);
}
}

public class Schema1 extends JsonSchema {
public static final LinkedHashMap<String, KeywordValidator> keywordToValidator = new LinkedHashMap<>(Map.ofEntries(
new KeywordEntry("type", new TypeValidator(Set.of(FrozenMap.class))),
new KeywordEntry("additionalProperties", new AdditionalPropertiesValidator(AdditionalProperties.class))
));
protected static SchemaMap getMapOutputInstance(FrozenMap<? extends String, ?> arg) {
protected static SchemaMap getMapOutputInstance(FrozenMap<String, Integer> arg) {

return new SchemaMap(arg);
}
public static SchemaMap validate(Map<String, Object> arg, SchemaConfiguration configuration) {
public static SchemaMap validate(Map<String, Integer> arg, SchemaConfiguration configuration) {

return JsonSchema.validate(Schema1.class, arg, configuration);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,44 @@ public class AdditionalProperties extends NotAnyTypeJsonSchema {}


public static class HeadersMap extends FrozenMap<String, Object> {
HeadersMap(FrozenMap<? extends String, ?> m) {

HeadersMap(FrozenMap<String, Object> m) {

super(m);
}
public static final Set<String> requiredKeys = Set.of(
"int32",
"ref-content-schema-header",
"ref-schema-header",
"stringHeader"
);
public static final Set<String> optionalKeys = Set.of(
"numberHeader"
);
public static HeadersMap of(Map<String, Object> arg, SchemaConfiguration configuration) {

return Headers1.validate(arg, configuration);
}

public int int32() {

return (int) get("int32");

}

public String stringHeader() {

return (String) get("stringHeader");

}

public String numberHeader() {

String key = "numberHeader";
throwIfKeyNotPresent(key);
return (String) get(key);

}
}

public class Headers1 extends JsonSchema {
Expand All @@ -54,10 +86,12 @@ public class Headers1 extends JsonSchema {
))),
new KeywordEntry("additionalProperties", new AdditionalPropertiesValidator(AdditionalProperties.class))
));
protected static HeadersMap getMapOutputInstance(FrozenMap<? extends String, ?> arg) {
protected static HeadersMap getMapOutputInstance(FrozenMap<String, Object> arg) {

return new HeadersMap(arg);
}
public static HeadersMap validate(Map<String, Object> arg, SchemaConfiguration configuration) {

return JsonSchema.validate(Headers1.class, arg, configuration);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,41 @@ public class Discriminator extends StringJsonSchema {}


public static class AbstractStepMessageMap extends FrozenMap<String, Object> {
AbstractStepMessageMap(FrozenMap<? extends String, ?> m) {

AbstractStepMessageMap(FrozenMap<String, Object> m) {

super(m);
}
public static final Set<String> requiredKeys = Set.of(
"description",
"discriminator",
"sequenceNumber"
);
public static final Set<String> optionalKeys = Set.of();
public static AbstractStepMessageMap of(Map<String, Object> arg, SchemaConfiguration configuration) {

return AbstractStepMessage1.validate(arg, configuration);
}

public Object description() {
return get("description");
}

public String discriminator() {

return (String) get("discriminator");

}

public Object sequenceNumber() {
return get("sequenceNumber");
}

public Object getAdditionalProperty(String name) {
throwIfKeyKnown(name, requiredKeys, optionalKeys);
throwIfKeyNotPresent(name);
return get(name);
}
}

public class AbstractStepMessage1 extends JsonSchema {
Expand All @@ -49,10 +78,12 @@ public class AbstractStepMessage1 extends JsonSchema {
"sequenceNumber"
)))
));
protected static AbstractStepMessageMap getMapOutputInstance(FrozenMap<? extends String, ?> arg) {
protected static AbstractStepMessageMap getMapOutputInstance(FrozenMap<String, Object> arg) {

return new AbstractStepMessageMap(arg);
}
public static AbstractStepMessageMap validate(Map<String, Object> arg, SchemaConfiguration configuration) {

return JsonSchema.validate(AbstractStepMessage1.class, arg, configuration);
}
}
Expand Down
Loading