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

Java adds security to ApiClient #384

Merged
merged 27 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
6eea9b7
Adds securityInfo
spacether Jan 28, 2024
dc7f96c
Adds two security requirement object classes
spacether Jan 28, 2024
4865731
Adds one file per security requirement object definition in java
spacether Jan 29, 2024
0844e7c
Updates security requirement object classnames
spacether Jan 29, 2024
d15de95
Updates sro constructors
spacether Jan 29, 2024
e0d2a11
CodegenServers renamed to CodegenList so it can be used for sercurity…
spacether Jan 29, 2024
0c8417b
Adds classes to store security info, partial implementation
spacether Jan 30, 2024
e1ca80e
Updates SecurityInfo template
spacether Jan 30, 2024
c551007
Updates security info class to have a constrctor where all securities…
spacether Jan 30, 2024
0da06ac
Fixes the class names of security requirement objects which are empty
spacether Jan 31, 2024
1381c0e
Makes MapBuilder generic
spacether Jan 31, 2024
7b94248
Changes MapBuilder property from schema to property
spacether Jan 31, 2024
5e7e7b7
Adds builders to CodegenList
spacether Jan 31, 2024
c9dd937
Fixes type errors in java client
spacether Jan 31, 2024
22e32de
security builders added in java layer
spacether Feb 1, 2024
b61d10b
Adds setters in SecurityInfo classes that will be used in builders
spacether Feb 1, 2024
1d29ebc
Sample regen
spacether Feb 2, 2024
ee14650
Updates python generation of security inti files
spacether Feb 2, 2024
31f15d8
Samples regen for security client
spacether Feb 2, 2024
1c77917
Fixes python petstore security files
spacether Feb 2, 2024
0221fb8
Removes toSecurityRequirementObjectFilename
spacether Feb 2, 2024
1d3c84a
Fixes toSecurityFilename for python
spacether Feb 2, 2024
6b667c6
Fixes python servers init files
spacether Feb 2, 2024
e431a23
Adds SecurityInfo to ApiConfiguration
spacether Feb 2, 2024
afee746
Samples and docs regnerated
spacether Feb 2, 2024
bfe8fe8
Java component tests regen to eliminate removed MapMaker references
spacether Feb 2, 2024
063b075
Samples updated
spacether Feb 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 4 additions & 2 deletions docs/generators/java.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|ComponentParameters|✗|OAS3
|ComponentRequestBodies|✗|OAS3
|ComponentHeaders|✗|OAS3
|ComponentSecuritySchemes||OAS3
|ComponentSecuritySchemes||OAS3
|ComponentLinks|✗|OAS3
|ComponentCallbacks|✗|OAS3
|ComponentPathItems|✗|OAS3
Expand All @@ -238,7 +238,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|Paths|✗|OAS2,OAS3
|Webhooks|✗|OAS3
|Components|✓|OAS3
|Security||OAS2,OAS3
|Security||OAS2,OAS3
|Tags|✗|OAS2,OAS3
|ExternalDocs|✗|OAS2,OAS3

Expand All @@ -249,6 +249,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|Responses_RangedResponseCodes|✗|OAS3
|Responses_Default|✗|OAS3
|Responses_RedirectionResponse|✗|OAS3
|Security|✓|OAS2,OAS3
|Servers|✓|OAS3

### Parameter Feature
| Name | Supported | Defined By |
Expand Down
2 changes: 2 additions & 0 deletions docs/generators/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|Responses_RangedResponseCodes|✓|OAS3
|Responses_Default|✓|OAS3
|Responses_RedirectionResponse|✓|OAS3
|Security|✓|OAS2,OAS3
|Servers|✓|OAS3

### Parameter Feature
| Name | Supported | Defined By |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,13 @@ src/main/java/org/openapijsonschematools/client/exceptions/InvalidTypeException.
src/main/java/org/openapijsonschematools/client/exceptions/UnsetPropertyException.java
src/main/java/org/openapijsonschematools/client/exceptions/ValidationException.java
src/main/java/org/openapijsonschematools/client/schemas/AnyTypeJsonSchema.java
src/main/java/org/openapijsonschematools/client/schemas/BaseBuilder.java
src/main/java/org/openapijsonschematools/client/schemas/BooleanJsonSchema.java
src/main/java/org/openapijsonschematools/client/schemas/DateJsonSchema.java
src/main/java/org/openapijsonschematools/client/schemas/DateTimeJsonSchema.java
src/main/java/org/openapijsonschematools/client/schemas/DecimalJsonSchema.java
src/main/java/org/openapijsonschematools/client/schemas/DoubleJsonSchema.java
src/main/java/org/openapijsonschematools/client/schemas/FloatJsonSchema.java
src/main/java/org/openapijsonschematools/client/schemas/GenericBuilder.java
src/main/java/org/openapijsonschematools/client/schemas/Int32JsonSchema.java
src/main/java/org/openapijsonschematools/client/schemas/Int64JsonSchema.java
src/main/java/org/openapijsonschematools/client/schemas/IntJsonSchema.java
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
import org.openapijsonschematools.client.exceptions.UnsetPropertyException;
import org.openapijsonschematools.client.exceptions.ValidationException;
import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema;
import org.openapijsonschematools.client.schemas.BaseBuilder;
import org.openapijsonschematools.client.schemas.BooleanJsonSchema;
import org.openapijsonschematools.client.schemas.GenericBuilder;
import org.openapijsonschematools.client.schemas.validation.FrozenMap;
import org.openapijsonschematools.client.schemas.validation.JsonSchema;
import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo;
Expand Down Expand Up @@ -225,7 +225,7 @@ default T additionalProperty(String key, boolean value) throws InvalidAdditional
}
}

public static class AdditionalpropertiesAllowsASchemaWhichShouldValidateMapBuilder implements BaseBuilder<@Nullable Object>, SetterForFoo<AdditionalpropertiesAllowsASchemaWhichShouldValidateMapBuilder>, SetterForBar<AdditionalpropertiesAllowsASchemaWhichShouldValidateMapBuilder>, SetterForAdditionalProperties<AdditionalpropertiesAllowsASchemaWhichShouldValidateMapBuilder> {
public static class AdditionalpropertiesAllowsASchemaWhichShouldValidateMapBuilder implements GenericBuilder<Map<String, @Nullable Object>>, SetterForFoo<AdditionalpropertiesAllowsASchemaWhichShouldValidateMapBuilder>, SetterForBar<AdditionalpropertiesAllowsASchemaWhichShouldValidateMapBuilder>, SetterForAdditionalProperties<AdditionalpropertiesAllowsASchemaWhichShouldValidateMapBuilder> {
private final Map<String, @Nullable Object> instance;
private static final Set<String> knownKeys = Set.of(
"foo",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import org.openapijsonschematools.client.exceptions.UnsetPropertyException;
import org.openapijsonschematools.client.exceptions.ValidationException;
import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema;
import org.openapijsonschematools.client.schemas.BaseBuilder;
import org.openapijsonschematools.client.schemas.GenericBuilder;
import org.openapijsonschematools.client.schemas.UnsetAddPropsSetter;
import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator;
import org.openapijsonschematools.client.schemas.validation.FrozenList;
Expand Down Expand Up @@ -206,7 +206,7 @@ default T bar(Map<String, ?> value) {
}
}

public static class AdditionalpropertiesAreAllowedByDefaultMapBuilder extends UnsetAddPropsSetter<AdditionalpropertiesAreAllowedByDefaultMapBuilder> implements BaseBuilder<@Nullable Object>, SetterForFoo<AdditionalpropertiesAreAllowedByDefaultMapBuilder>, SetterForBar<AdditionalpropertiesAreAllowedByDefaultMapBuilder> {
public static class AdditionalpropertiesAreAllowedByDefaultMapBuilder extends UnsetAddPropsSetter<AdditionalpropertiesAreAllowedByDefaultMapBuilder> implements GenericBuilder<Map<String, @Nullable Object>>, SetterForFoo<AdditionalpropertiesAreAllowedByDefaultMapBuilder>, SetterForBar<AdditionalpropertiesAreAllowedByDefaultMapBuilder> {
private final Map<String, @Nullable Object> instance;
private static final Set<String> knownKeys = Set.of(
"foo",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
import org.openapijsonschematools.client.exceptions.InvalidTypeException;
import org.openapijsonschematools.client.exceptions.UnsetPropertyException;
import org.openapijsonschematools.client.exceptions.ValidationException;
import org.openapijsonschematools.client.schemas.BaseBuilder;
import org.openapijsonschematools.client.schemas.BooleanJsonSchema;
import org.openapijsonschematools.client.schemas.GenericBuilder;
import org.openapijsonschematools.client.schemas.validation.FrozenMap;
import org.openapijsonschematools.client.schemas.validation.JsonSchema;
import org.openapijsonschematools.client.schemas.validation.JsonSchemaInfo;
Expand Down Expand Up @@ -72,7 +72,7 @@ default T additionalProperty(String key, boolean value) throws InvalidAdditional
}
}

public static class AdditionalpropertiesCanExistByItselfMapBuilder implements BaseBuilder<Boolean>, SetterForAdditionalProperties<AdditionalpropertiesCanExistByItselfMapBuilder> {
public static class AdditionalpropertiesCanExistByItselfMapBuilder implements GenericBuilder<Map<String, Boolean>>, SetterForAdditionalProperties<AdditionalpropertiesCanExistByItselfMapBuilder> {
private final Map<String, Boolean> instance;
private static final Set<String> knownKeys = Set.of();
public Set<String> getKnownKeys() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
import org.openapijsonschematools.client.exceptions.UnsetPropertyException;
import org.openapijsonschematools.client.exceptions.ValidationException;
import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema;
import org.openapijsonschematools.client.schemas.BaseBuilder;
import org.openapijsonschematools.client.schemas.BooleanJsonSchema;
import org.openapijsonschematools.client.schemas.GenericBuilder;
import org.openapijsonschematools.client.schemas.UnsetAddPropsSetter;
import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator;
import org.openapijsonschematools.client.schemas.validation.FrozenList;
Expand Down Expand Up @@ -144,7 +144,7 @@ default T foo(Map<String, ?> value) {
}
}

public static class Schema0MapBuilder extends UnsetAddPropsSetter<Schema0MapBuilder> implements BaseBuilder<@Nullable Object>, SetterForFoo<Schema0MapBuilder> {
public static class Schema0MapBuilder extends UnsetAddPropsSetter<Schema0MapBuilder> implements GenericBuilder<Map<String, @Nullable Object>>, SetterForFoo<Schema0MapBuilder> {
private final Map<String, @Nullable Object> instance;
private static final Set<String> knownKeys = Set.of(
"foo"
Expand Down Expand Up @@ -400,7 +400,7 @@ default T additionalProperty(String key, boolean value) throws InvalidAdditional
}
}

public static class AdditionalpropertiesShouldNotLookInApplicatorsMapBuilder implements BaseBuilder<Boolean>, SetterForAdditionalProperties<AdditionalpropertiesShouldNotLookInApplicatorsMapBuilder> {
public static class AdditionalpropertiesShouldNotLookInApplicatorsMapBuilder implements GenericBuilder<Map<String, Boolean>>, SetterForAdditionalProperties<AdditionalpropertiesShouldNotLookInApplicatorsMapBuilder> {
private final Map<String, Boolean> instance;
private static final Set<String> knownKeys = Set.of();
public Set<String> getKnownKeys() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import org.openapijsonschematools.client.exceptions.InvalidTypeException;
import org.openapijsonschematools.client.exceptions.UnsetPropertyException;
import org.openapijsonschematools.client.exceptions.ValidationException;
import org.openapijsonschematools.client.schemas.BaseBuilder;
import org.openapijsonschematools.client.schemas.GenericBuilder;
import org.openapijsonschematools.client.schemas.IntJsonSchema;
import org.openapijsonschematools.client.schemas.StringJsonSchema;
import org.openapijsonschematools.client.schemas.UnsetAddPropsSetter;
Expand Down Expand Up @@ -106,7 +106,7 @@ default T bar(double value) {
}
}

public static class Schema0Map0Builder extends UnsetAddPropsSetter<Schema0Map0Builder> implements BaseBuilder<@Nullable Object> {
public static class Schema0Map0Builder extends UnsetAddPropsSetter<Schema0Map0Builder> implements GenericBuilder<Map<String, @Nullable Object>> {
private final Map<String, @Nullable Object> instance;
private static final Set<String> knownKeys = Set.of(
"bar"
Expand Down Expand Up @@ -391,7 +391,7 @@ default T foo(String value) {
}
}

public static class Schema1Map0Builder extends UnsetAddPropsSetter<Schema1Map0Builder> implements BaseBuilder<@Nullable Object> {
public static class Schema1Map0Builder extends UnsetAddPropsSetter<Schema1Map0Builder> implements GenericBuilder<Map<String, @Nullable Object>> {
private final Map<String, @Nullable Object> instance;
private static final Set<String> knownKeys = Set.of(
"foo"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import org.openapijsonschematools.client.exceptions.InvalidTypeException;
import org.openapijsonschematools.client.exceptions.UnsetPropertyException;
import org.openapijsonschematools.client.exceptions.ValidationException;
import org.openapijsonschematools.client.schemas.BaseBuilder;
import org.openapijsonschematools.client.schemas.GenericBuilder;
import org.openapijsonschematools.client.schemas.IntJsonSchema;
import org.openapijsonschematools.client.schemas.NullJsonSchema;
import org.openapijsonschematools.client.schemas.StringJsonSchema;
Expand Down Expand Up @@ -89,7 +89,7 @@ default T foo(String value) {
}
}

public static class Schema0Map0Builder extends UnsetAddPropsSetter<Schema0Map0Builder> implements BaseBuilder<@Nullable Object> {
public static class Schema0Map0Builder extends UnsetAddPropsSetter<Schema0Map0Builder> implements GenericBuilder<Map<String, @Nullable Object>> {
private final Map<String, @Nullable Object> instance;
private static final Set<String> knownKeys = Set.of(
"foo"
Expand Down Expand Up @@ -374,7 +374,7 @@ default T baz(Void value) {
}
}

public static class Schema1Map0Builder extends UnsetAddPropsSetter<Schema1Map0Builder> implements BaseBuilder<@Nullable Object> {
public static class Schema1Map0Builder extends UnsetAddPropsSetter<Schema1Map0Builder> implements GenericBuilder<Map<String, @Nullable Object>> {
private final Map<String, @Nullable Object> instance;
private static final Set<String> knownKeys = Set.of(
"baz"
Expand Down Expand Up @@ -677,7 +677,7 @@ default T bar(double value) {
}
}

public static class AllofWithBaseSchemaMap0Builder extends UnsetAddPropsSetter<AllofWithBaseSchemaMap0Builder> implements BaseBuilder<@Nullable Object> {
public static class AllofWithBaseSchemaMap0Builder extends UnsetAddPropsSetter<AllofWithBaseSchemaMap0Builder> implements GenericBuilder<Map<String, @Nullable Object>> {
private final Map<String, @Nullable Object> instance;
private static final Set<String> knownKeys = Set.of(
"bar"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import org.openapijsonschematools.client.exceptions.InvalidTypeException;
import org.openapijsonschematools.client.exceptions.UnsetPropertyException;
import org.openapijsonschematools.client.exceptions.ValidationException;
import org.openapijsonschematools.client.schemas.BaseBuilder;
import org.openapijsonschematools.client.schemas.GenericBuilder;
import org.openapijsonschematools.client.schemas.IntJsonSchema;
import org.openapijsonschematools.client.schemas.StringJsonSchema;
import org.openapijsonschematools.client.schemas.UnsetAddPropsSetter;
Expand Down Expand Up @@ -106,7 +106,7 @@ default T bar(double value) {
}
}

public static class Schema0Map0Builder extends UnsetAddPropsSetter<Schema0Map0Builder> implements BaseBuilder<@Nullable Object> {
public static class Schema0Map0Builder extends UnsetAddPropsSetter<Schema0Map0Builder> implements GenericBuilder<Map<String, @Nullable Object>> {
private final Map<String, @Nullable Object> instance;
private static final Set<String> knownKeys = Set.of(
"bar"
Expand Down Expand Up @@ -391,7 +391,7 @@ default T foo(String value) {
}
}

public static class Schema1Map0Builder extends UnsetAddPropsSetter<Schema1Map0Builder> implements BaseBuilder<@Nullable Object> {
public static class Schema1Map0Builder extends UnsetAddPropsSetter<Schema1Map0Builder> implements GenericBuilder<Map<String, @Nullable Object>> {
private final Map<String, @Nullable Object> instance;
private static final Set<String> knownKeys = Set.of(
"foo"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import org.openapijsonschematools.client.exceptions.InvalidTypeException;
import org.openapijsonschematools.client.exceptions.UnsetPropertyException;
import org.openapijsonschematools.client.exceptions.ValidationException;
import org.openapijsonschematools.client.schemas.BaseBuilder;
import org.openapijsonschematools.client.schemas.GenericBuilder;
import org.openapijsonschematools.client.schemas.SetMaker;
import org.openapijsonschematools.client.schemas.UnsetAddPropsSetter;
import org.openapijsonschematools.client.schemas.validation.FrozenMap;
Expand Down Expand Up @@ -235,7 +235,7 @@ default T foo(StringFooEnums value) {
}
}

public static class EnumsInPropertiesMap0Builder extends UnsetAddPropsSetter<EnumsInPropertiesMap0Builder> implements BaseBuilder<@Nullable Object>, SetterForFoo<EnumsInPropertiesMap0Builder> {
public static class EnumsInPropertiesMap0Builder extends UnsetAddPropsSetter<EnumsInPropertiesMap0Builder> implements GenericBuilder<Map<String, @Nullable Object>>, SetterForFoo<EnumsInPropertiesMap0Builder> {
private final Map<String, @Nullable Object> instance;
private static final Set<String> knownKeys = Set.of(
"bar",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import org.openapijsonschematools.client.exceptions.UnsetPropertyException;
import org.openapijsonschematools.client.exceptions.ValidationException;
import org.openapijsonschematools.client.schemas.AnyTypeJsonSchema;
import org.openapijsonschematools.client.schemas.BaseBuilder;
import org.openapijsonschematools.client.schemas.GenericBuilder;
import org.openapijsonschematools.client.schemas.NotAnyTypeJsonSchema;
import org.openapijsonschematools.client.schemas.UnsetAddPropsSetter;
import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator;
Expand Down Expand Up @@ -133,7 +133,7 @@ default T foo(Map<String, ?> value) {
}
}

public static class ForbiddenPropertyMapBuilder extends UnsetAddPropsSetter<ForbiddenPropertyMapBuilder> implements BaseBuilder<@Nullable Object>, SetterForFoo<ForbiddenPropertyMapBuilder> {
public static class ForbiddenPropertyMapBuilder extends UnsetAddPropsSetter<ForbiddenPropertyMapBuilder> implements GenericBuilder<Map<String, @Nullable Object>>, SetterForFoo<ForbiddenPropertyMapBuilder> {
private final Map<String, @Nullable Object> instance;
private static final Set<String> knownKeys = Set.of(
"foo"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import org.openapijsonschematools.client.exceptions.InvalidTypeException;
import org.openapijsonschematools.client.exceptions.UnsetPropertyException;
import org.openapijsonschematools.client.exceptions.ValidationException;
import org.openapijsonschematools.client.schemas.BaseBuilder;
import org.openapijsonschematools.client.schemas.GenericBuilder;
import org.openapijsonschematools.client.schemas.UnsetAddPropsSetter;
import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator;
import org.openapijsonschematools.client.schemas.validation.DefaultValueMethod;
Expand Down Expand Up @@ -131,7 +131,7 @@ default T bar(String value) {
}
}

public static class InvalidStringValueForDefaultMapBuilder extends UnsetAddPropsSetter<InvalidStringValueForDefaultMapBuilder> implements BaseBuilder<@Nullable Object>, SetterForBar<InvalidStringValueForDefaultMapBuilder> {
public static class InvalidStringValueForDefaultMapBuilder extends UnsetAddPropsSetter<InvalidStringValueForDefaultMapBuilder> implements GenericBuilder<Map<String, @Nullable Object>>, SetterForBar<InvalidStringValueForDefaultMapBuilder> {
private final Map<String, @Nullable Object> instance;
private static final Set<String> knownKeys = Set.of(
"bar"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import org.openapijsonschematools.client.exceptions.InvalidTypeException;
import org.openapijsonschematools.client.exceptions.UnsetPropertyException;
import org.openapijsonschematools.client.exceptions.ValidationException;
import org.openapijsonschematools.client.schemas.BaseBuilder;
import org.openapijsonschematools.client.schemas.GenericBuilder;
import org.openapijsonschematools.client.schemas.StringJsonSchema;
import org.openapijsonschematools.client.schemas.UnsetAddPropsSetter;
import org.openapijsonschematools.client.schemas.validation.BooleanSchemaValidator;
Expand Down Expand Up @@ -89,7 +89,7 @@ default T foo(String value) {
}
}

public static class NotMapBuilder extends UnsetAddPropsSetter<NotMapBuilder> implements BaseBuilder<@Nullable Object>, SetterForFoo<NotMapBuilder> {
public static class NotMapBuilder extends UnsetAddPropsSetter<NotMapBuilder> implements GenericBuilder<Map<String, @Nullable Object>>, SetterForFoo<NotMapBuilder> {
private final Map<String, @Nullable Object> instance;
private static final Set<String> knownKeys = Set.of(
"foo"
Expand Down
Loading