Skip to content

Commit

Permalink
Java, protect output class direct instantiation (#339)
Browse files Browse the repository at this point in the history
* Samples regen

* Samples regen
  • Loading branch information
spacether committed Dec 18, 2023
1 parent 5804717 commit ffc45df
Show file tree
Hide file tree
Showing 199 changed files with 247 additions and 247 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static class Bar extends AnyTypeJsonSchema {}


public static class AdditionalpropertiesAllowsASchemaWhichShouldValidateMap extends FrozenMap<Object> {
AdditionalpropertiesAllowsASchemaWhichShouldValidateMap(FrozenMap<Object> m) {
protected AdditionalpropertiesAllowsASchemaWhichShouldValidateMap(FrozenMap<Object> m) {
super(m);
}
public static final Set<String> requiredKeys = Set.of();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static class Bar extends AnyTypeJsonSchema {}


public static class AdditionalpropertiesAreAllowedByDefaultMap extends FrozenMap<Object> {
AdditionalpropertiesAreAllowedByDefaultMap(FrozenMap<Object> m) {
protected AdditionalpropertiesAreAllowedByDefaultMap(FrozenMap<Object> m) {
super(m);
}
public static final Set<String> requiredKeys = Set.of();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public static class AdditionalProperties extends BooleanJsonSchema {}


public static class AdditionalpropertiesCanExistByItselfMap extends FrozenMap<Boolean> {
AdditionalpropertiesCanExistByItselfMap(FrozenMap<Boolean> m) {
protected AdditionalpropertiesCanExistByItselfMap(FrozenMap<Boolean> m) {
super(m);
}
public static final Set<String> requiredKeys = Set.of();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static class Foo extends AnyTypeJsonSchema {}


public static class Schema0Map extends FrozenMap<Object> {
Schema0Map(FrozenMap<Object> m) {
protected Schema0Map(FrozenMap<Object> m) {
super(m);
}
public static final Set<String> requiredKeys = Set.of();
Expand Down Expand Up @@ -244,7 +244,7 @@ public Object getNewInstance(Object arg, List<Object> pathToItem, PathToSchemasM
}

public static class AdditionalpropertiesShouldNotLookInApplicatorsMap extends FrozenMap<Boolean> {
AdditionalpropertiesShouldNotLookInApplicatorsMap(FrozenMap<Boolean> m) {
protected AdditionalpropertiesShouldNotLookInApplicatorsMap(FrozenMap<Boolean> m) {
super(m);
}
public static final Set<String> requiredKeys = Set.of();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static class Bar extends IntJsonSchema {}


public static class Schema0Map extends FrozenMap<Object> {
Schema0Map(FrozenMap<Object> m) {
protected Schema0Map(FrozenMap<Object> m) {
super(m);
}
public static final Set<String> requiredKeys = Set.of(
Expand Down Expand Up @@ -245,7 +245,7 @@ public static class Foo extends StringJsonSchema {}


public static class Schema1Map extends FrozenMap<Object> {
Schema1Map(FrozenMap<Object> m) {
protected Schema1Map(FrozenMap<Object> m) {
super(m);
}
public static final Set<String> requiredKeys = Set.of(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static class Foo extends StringJsonSchema {}


public static class Schema0Map extends FrozenMap<Object> {
Schema0Map(FrozenMap<Object> m) {
protected Schema0Map(FrozenMap<Object> m) {
super(m);
}
public static final Set<String> requiredKeys = Set.of(
Expand Down Expand Up @@ -246,7 +246,7 @@ public static class Baz extends NullJsonSchema {}


public static class Schema1Map extends FrozenMap<Object> {
Schema1Map(FrozenMap<Object> m) {
protected Schema1Map(FrozenMap<Object> m) {
super(m);
}
public static final Set<String> requiredKeys = Set.of(
Expand Down Expand Up @@ -453,7 +453,7 @@ public static class Bar extends IntJsonSchema {}


public static class AllofWithBaseSchemaMap extends FrozenMap<Object> {
AllofWithBaseSchemaMap(FrozenMap<Object> m) {
protected AllofWithBaseSchemaMap(FrozenMap<Object> m) {
super(m);
}
public static final Set<String> requiredKeys = Set.of(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static class Bar extends IntJsonSchema {}


public static class Schema0Map extends FrozenMap<Object> {
Schema0Map(FrozenMap<Object> m) {
protected Schema0Map(FrozenMap<Object> m) {
super(m);
}
public static final Set<String> requiredKeys = Set.of(
Expand Down Expand Up @@ -245,7 +245,7 @@ public static class Foo extends StringJsonSchema {}


public static class Schema1Map extends FrozenMap<Object> {
Schema1Map(FrozenMap<Object> m) {
protected Schema1Map(FrozenMap<Object> m) {
super(m);
}
public static final Set<String> requiredKeys = Set.of(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public static class Items extends AnyTypeJsonSchema {}


public static class ArrayTypeMatchesArraysList extends FrozenList<Object> {
ArrayTypeMatchesArraysList(FrozenList<Object> m) {
protected ArrayTypeMatchesArraysList(FrozenList<Object> m) {
super(m);
}
public static ArrayTypeMatchesArraysList of(List<Object> arg, SchemaConfiguration configuration) throws ValidationException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public Object getNewInstance(Object arg, List<Object> pathToItem, PathToSchemasM
}

public static class EnumsInPropertiesMap extends FrozenMap<Object> {
EnumsInPropertiesMap(FrozenMap<Object> m) {
protected EnumsInPropertiesMap(FrozenMap<Object> m) {
super(m);
}
public static final Set<String> requiredKeys = Set.of(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static class Foo extends NotAnyTypeJsonSchema {}


public static class ForbiddenPropertyMap extends FrozenMap<Object> {
ForbiddenPropertyMap(FrozenMap<Object> m) {
protected ForbiddenPropertyMap(FrozenMap<Object> m) {
super(m);
}
public static final Set<String> requiredKeys = Set.of();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public Object getNewInstance(Object arg, List<Object> pathToItem, PathToSchemasM
}

public static class InvalidStringValueForDefaultMap extends FrozenMap<Object> {
InvalidStringValueForDefaultMap(FrozenMap<Object> m) {
protected InvalidStringValueForDefaultMap(FrozenMap<Object> m) {
super(m);
}
public static final Set<String> requiredKeys = Set.of();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public static class Items3 extends NumberJsonSchema {}


public static class ItemsList extends FrozenList<Number> {
ItemsList(FrozenList<Number> m) {
protected ItemsList(FrozenList<Number> m) {
super(m);
}
public static ItemsList of(List<Number> arg, SchemaConfiguration configuration) throws ValidationException {
Expand Down Expand Up @@ -94,7 +94,7 @@ public Object getNewInstance(Object arg, List<Object> pathToItem, PathToSchemasM
}

public static class ItemsList1 extends FrozenList<ItemsList> {
ItemsList1(FrozenList<ItemsList> m) {
protected ItemsList1(FrozenList<ItemsList> m) {
super(m);
}
public static ItemsList1 of(List<List<Number>> arg, SchemaConfiguration configuration) throws ValidationException {
Expand Down Expand Up @@ -161,7 +161,7 @@ public Object getNewInstance(Object arg, List<Object> pathToItem, PathToSchemasM
}

public static class ItemsList2 extends FrozenList<ItemsList1> {
ItemsList2(FrozenList<ItemsList1> m) {
protected ItemsList2(FrozenList<ItemsList1> m) {
super(m);
}
public static ItemsList2 of(List<List<List<Number>>> arg, SchemaConfiguration configuration) throws ValidationException {
Expand Down Expand Up @@ -228,7 +228,7 @@ public Object getNewInstance(Object arg, List<Object> pathToItem, PathToSchemasM
}

public static class NestedItemsList extends FrozenList<ItemsList2> {
NestedItemsList(FrozenList<ItemsList2> m) {
protected NestedItemsList(FrozenList<ItemsList2> m) {
super(m);
}
public static NestedItemsList of(List<List<List<List<Number>>>> arg, SchemaConfiguration configuration) throws ValidationException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static class Foo extends StringJsonSchema {}


public static class NotMap extends FrozenMap<Object> {
NotMap(FrozenMap<Object> m) {
protected NotMap(FrozenMap<Object> m) {
super(m);
}
public static final Set<String> requiredKeys = Set.of();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static class Bar extends StringJsonSchema {}


public static class ObjectPropertiesValidationMap extends FrozenMap<Object> {
ObjectPropertiesValidationMap(FrozenMap<Object> m) {
protected ObjectPropertiesValidationMap(FrozenMap<Object> m) {
super(m);
}
public static final Set<String> requiredKeys = Set.of();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static class Bar extends IntJsonSchema {}


public static class Schema0Map extends FrozenMap<Object> {
Schema0Map(FrozenMap<Object> m) {
protected Schema0Map(FrozenMap<Object> m) {
super(m);
}
public static final Set<String> requiredKeys = Set.of(
Expand Down Expand Up @@ -245,7 +245,7 @@ public static class Foo extends StringJsonSchema {}


public static class Schema1Map extends FrozenMap<Object> {
Schema1Map(FrozenMap<Object> m) {
protected Schema1Map(FrozenMap<Object> m) {
super(m);
}
public static final Set<String> requiredKeys = Set.of(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class OneofWithRequired {


public static class Schema0Map extends FrozenMap<Object> {
Schema0Map(FrozenMap<Object> m) {
protected Schema0Map(FrozenMap<Object> m) {
super(m);
}
public static final Set<String> requiredKeys = Set.of(
Expand Down Expand Up @@ -239,7 +239,7 @@ public Object getNewInstance(Object arg, List<Object> pathToItem, PathToSchemasM
}

public static class Schema1Map extends FrozenMap<Object> {
Schema1Map(FrozenMap<Object> m) {
protected Schema1Map(FrozenMap<Object> m) {
super(m);
}
public static final Set<String> requiredKeys = Set.of(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public static class Foofbar extends NumberJsonSchema {}


public static class PropertiesWithEscapedCharactersMap extends FrozenMap<Object> {
PropertiesWithEscapedCharactersMap(FrozenMap<Object> m) {
protected PropertiesWithEscapedCharactersMap(FrozenMap<Object> m) {
super(m);
}
public static final Set<String> requiredKeys = Set.of();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static class Ref extends StringJsonSchema {}


public static class PropertyNamedRefThatIsNotAReferenceMap extends FrozenMap<Object> {
PropertyNamedRefThatIsNotAReferenceMap(FrozenMap<Object> m) {
protected PropertyNamedRefThatIsNotAReferenceMap(FrozenMap<Object> m) {
super(m);
}
public static final Set<String> requiredKeys = Set.of();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class RefInAdditionalproperties {


public static class RefInAdditionalpropertiesMap extends FrozenMap<Object> {
RefInAdditionalpropertiesMap(FrozenMap<Object> m) {
protected RefInAdditionalpropertiesMap(FrozenMap<Object> m) {
super(m);
}
public static final Set<String> requiredKeys = Set.of();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class RefInItems {


public static class RefInItemsList extends FrozenList<Object> {
RefInItemsList(FrozenList<Object> m) {
protected RefInItemsList(FrozenList<Object> m) {
super(m);
}
public static RefInItemsList of(List<Object> arg, SchemaConfiguration configuration) throws ValidationException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class RefInProperty {


public static class RefInPropertyMap extends FrozenMap<Object> {
RefInPropertyMap(FrozenMap<Object> m) {
protected RefInPropertyMap(FrozenMap<Object> m) {
super(m);
}
public static final Set<String> requiredKeys = Set.of();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static class Foo extends AnyTypeJsonSchema {}


public static class RequiredDefaultValidationMap extends FrozenMap<Object> {
RequiredDefaultValidationMap(FrozenMap<Object> m) {
protected RequiredDefaultValidationMap(FrozenMap<Object> m) {
super(m);
}
public static final Set<String> requiredKeys = Set.of();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static class Bar extends AnyTypeJsonSchema {}


public static class RequiredValidationMap extends FrozenMap<Object> {
RequiredValidationMap(FrozenMap<Object> m) {
protected RequiredValidationMap(FrozenMap<Object> m) {
super(m);
}
public static final Set<String> requiredKeys = Set.of(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static class Foo extends AnyTypeJsonSchema {}


public static class RequiredWithEmptyArrayMap extends FrozenMap<Object> {
RequiredWithEmptyArrayMap(FrozenMap<Object> m) {
protected RequiredWithEmptyArrayMap(FrozenMap<Object> m) {
super(m);
}
public static final Set<String> requiredKeys = Set.of();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class RequiredWithEscapedCharacters {


public static class RequiredWithEscapedCharactersMap extends FrozenMap<Object> {
RequiredWithEscapedCharactersMap(FrozenMap<Object> m) {
protected RequiredWithEscapedCharactersMap(FrozenMap<Object> m) {
super(m);
}
public static final Set<String> requiredKeys = Set.of(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public Object getNewInstance(Object arg, List<Object> pathToItem, PathToSchemasM
}

public static class TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap extends FrozenMap<Object> {
TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap(FrozenMap<Object> m) {
protected TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap(FrozenMap<Object> m) {
super(m);
}
public static final Set<String> requiredKeys = Set.of();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public Object getNewInstance(Object arg, List<Object> pathToItem, PathToSchemasM
}

public static class ArrayWithOutputClsSchemaList extends FrozenList<String> {
ArrayWithOutputClsSchemaList(FrozenList<String> m) {
protected ArrayWithOutputClsSchemaList(FrozenList<String> m) {
super(m);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public Object getNewInstance(Object arg, List<Object> pathToItem, PathToSchemasM
}

public static class ObjectWithOutputTypeSchemaMap extends FrozenMap<Object> {
ObjectWithOutputTypeSchemaMap(FrozenMap<Object> m) {
protected ObjectWithOutputTypeSchemaMap(FrozenMap<Object> m) {
super(m);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class Schema {


public static class SchemaList extends FrozenList<User.UserMap> {
SchemaList(FrozenList<User.UserMap> m) {
protected SchemaList(FrozenList<User.UserMap> m) {
super(m);
}
public static SchemaList of(List<Map<String, Object>> arg, SchemaConfiguration configuration) throws ValidationException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public static class AdditionalProperties extends NotAnyTypeJsonSchema {}


public static class HeadersMap extends FrozenMap<String> {
HeadersMap(FrozenMap<String> m) {
protected HeadersMap(FrozenMap<String> m) {
super(m);
}
public static final Set<String> requiredKeys = Set.of();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class Schema {


public static class SchemaList extends FrozenList<Pet.PetMap> {
SchemaList(FrozenList<Pet.PetMap> m) {
protected SchemaList(FrozenList<Pet.PetMap> m) {
super(m);
}
public static SchemaList of(List<Map<String, Object>> arg, SchemaConfiguration configuration) throws ValidationException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class Schema {


public static class SchemaList extends FrozenList<Pet.PetMap> {
SchemaList(FrozenList<Pet.PetMap> m) {
protected SchemaList(FrozenList<Pet.PetMap> m) {
super(m);
}
public static SchemaList of(List<Map<String, Object>> arg, SchemaConfiguration configuration) throws ValidationException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public static class AdditionalProperties extends NotAnyTypeJsonSchema {}


public static class HeadersMap extends FrozenMap<String> {
HeadersMap(FrozenMap<String> m) {
protected HeadersMap(FrozenMap<String> m) {
super(m);
}
public static final Set<String> requiredKeys = Set.of();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public static class AdditionalProperties extends Int32JsonSchema {}


public static class SchemaMap extends FrozenMap<Integer> {
SchemaMap(FrozenMap<Integer> m) {
protected SchemaMap(FrozenMap<Integer> m) {
super(m);
}
public static final Set<String> requiredKeys = Set.of();
Expand Down
Loading

0 comments on commit ffc45df

Please sign in to comment.