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
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import java.util.AbstractMap;

static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone());

// Number validation
Number validatedPayload = EnumWith0DoesNotMatchFalse.EnumWith0DoesNotMatchFalse1.validate(
// int validation
int validatedPayload = EnumWith0DoesNotMatchFalse.EnumWith0DoesNotMatchFalse1.validate(
0,
configuration
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import java.util.AbstractMap;

static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone());

// Number validation
Number validatedPayload = EnumWith1DoesNotMatchTrue.EnumWith1DoesNotMatchTrue1.validate(
// int validation
int validatedPayload = EnumWith1DoesNotMatchTrue.EnumWith1DoesNotMatchTrue1.validate(
1,
configuration
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ import java.util.AbstractMap;

static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone());

// Integer validation
Integer validatedPayload = InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf1.validate(
1,
// long validation
long validatedPayload = InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf1.validate(
1L,
configuration
);
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ NestedItems.NestedItemsList validatedPayload =
Arrays.asList(
Arrays.asList(
Arrays.asList(
3.14
1
)
)
)
Expand Down Expand Up @@ -110,7 +110,7 @@ NestedItems.ItemsList2 validatedPayload =
Arrays.asList(
Arrays.asList(
Arrays.asList(
3.14
1
)
)
),
Expand Down Expand Up @@ -173,7 +173,7 @@ NestedItems.ItemsList1 validatedPayload =
NestedItems.Items1.validate(
Arrays.asList(
Arrays.asList(
3.14
1
)
),
configuration
Expand Down Expand Up @@ -234,7 +234,7 @@ static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSch
NestedItems.ItemsList validatedPayload =
NestedItems.Items2.validate(
Arrays.asList(
3.14
1
),
configuration
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import java.util.AbstractMap;

static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone());

// Number validation
Number validatedPayload = SimpleEnumValidation.SimpleEnumValidation1.validate(
// int validation
int validatedPayload = SimpleEnumValidation.SimpleEnumValidation1.validate(
1,
configuration
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.TheDefaultKeywordDoesNo
MapMaker.makeMap(
new AbstractMap.SimpleEntry<>(
"alpha",
3.14
1
)
),
configuration
Expand All @@ -65,7 +65,7 @@ A class to store validated Map payloads
| Modifier and Type | Method and Description |
| ----------------- | ---------------------- |
| static [TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingMap](#thedefaultkeyworddoesnotdoanythingifthepropertyismissingmap) | of(Map<String, Object> arg, SchemaConfiguration configuration) |
| Number | alpha()<br>[optional] if omitted the server will use the default value of 5 |
| Number | alpha()<br>[optional] if omitted the server will use the default value of 5.0 |
| Object | getAdditionalProperty(String name)<br>provides type safety for additional properties |

## Input Map Keys
Expand All @@ -74,7 +74,7 @@ type: Map<String, Object>
```
| Key | Type | Description | Notes |
| --- | ---- | ------------ | ----- |
| **alpha** | Number | | [optional] if omitted the server will use the default value of 5 |
| **alpha** | Number | | [optional] if omitted the server will use the default value of 5.0 |
| **anyStringName** | Object | any string name can be used but the value must be the correct type | [optional] |

## Alpha
Expand All @@ -98,9 +98,9 @@ import java.util.AbstractMap;

static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSchemaKeywordFlags.ofNone());

// Number validation
Number validatedPayload = TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.Alpha.validate(
3.14,
// int validation
int validatedPayload = TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.Alpha.validate(
1,
configuration
);
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: typing.Mapping[str, schemas.INPUT_TYPES_ALL]
```
Key | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**alpha** | float, int | | [optional] if omitted the server will use the default value of 5
**alpha** | float, int | | [optional] if omitted the server will use the default value of 5.0
**any_string_name** | dict, schemas.immutabledict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.FileIO | any string name can be used but the value must be the correct type | [optional]

## TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissingDict
Expand All @@ -26,13 +26,13 @@ base class: schemas.immutabledict[str, schemas.OUTPUT_BASE_TYPES]
### &lowbar;&lowbar;new&lowbar;&lowbar; method
Keyword Argument | Type | Description | Notes
---------------- | ---- | ----------- | -----
**alpha** | float, int, schemas.Unset | | [optional] if omitted the server will use the default value of 5
**alpha** | float, int, schemas.Unset | | [optional] if omitted the server will use the default value of 5.0
**kwargs** | schemas.immutabledict, tuple, float, int, str, bool, None, bytes, schemas.FileIO | any string name can be used but the value must be the correct type | [optional] typed value is accessed with the get_additional_property_ method

### properties
Property | Type | Description | Notes
-------- | ---- | ----------- | -----
**alpha** | float, int, schemas.Unset | | [optional] if omitted the server will use the default value of 5
**alpha** | float, int, schemas.Unset | | [optional] if omitted the server will use the default value of 5.0

### methods
Method | Input Type | Return Type | Notes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,44 @@ static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSch
Schema.SchemaList validatedPayload =
Schema.Schema1.validate(
Arrays.asList(
MapMaker.makeMap(
new AbstractMap.SimpleEntry<>(
"id",
1L
),
new AbstractMap.SimpleEntry<>(
"username",
"a"
),
new AbstractMap.SimpleEntry<>(
"firstName",
"a"
),
new AbstractMap.SimpleEntry<>(
"lastName",
"a"
),
new AbstractMap.SimpleEntry<>(
"email",
"a"
),
new AbstractMap.SimpleEntry<>(
"password",
"a"
),
new AbstractMap.SimpleEntry<>(
"phone",
"a"
),
new AbstractMap.SimpleEntry<>(
"userStatus",
1
),
new AbstractMap.SimpleEntry<>(
"objectWithNoDeclaredPropsNullable",
(Void) null
)
)
),
configuration
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,50 @@ static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSch
Schema.SchemaList validatedPayload =
Schema.Schema1.validate(
Arrays.asList(
MapMaker.makeMap(
new AbstractMap.SimpleEntry<>(
"name",
"a"
),
new AbstractMap.SimpleEntry<>(
"photoUrls",
Arrays.asList(
"a"
)
),
new AbstractMap.SimpleEntry<>(
"id",
1L
),
new AbstractMap.SimpleEntry<>(
"category",
MapMaker.makeMap(
new AbstractMap.SimpleEntry<>(
"name",
"a"
),
new AbstractMap.SimpleEntry<>(
"id",
1L
)
)
),
new AbstractMap.SimpleEntry<>(
"tags",
Arrays.asList(
MapMaker.makeMap(
new AbstractMap.SimpleEntry<>(
"name",
"a"
)
)
)
),
new AbstractMap.SimpleEntry<>(
"status",
"available"
)
)
),
configuration
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,50 @@ static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSch
Schema.SchemaList validatedPayload =
Schema.Schema1.validate(
Arrays.asList(
MapMaker.makeMap(
new AbstractMap.SimpleEntry<>(
"name",
"a"
),
new AbstractMap.SimpleEntry<>(
"photoUrls",
Arrays.asList(
"a"
)
),
new AbstractMap.SimpleEntry<>(
"id",
1L
),
new AbstractMap.SimpleEntry<>(
"category",
MapMaker.makeMap(
new AbstractMap.SimpleEntry<>(
"name",
"a"
),
new AbstractMap.SimpleEntry<>(
"id",
1L
)
)
),
new AbstractMap.SimpleEntry<>(
"tags",
Arrays.asList(
MapMaker.makeMap(
new AbstractMap.SimpleEntry<>(
"name",
"a"
)
)
)
),
new AbstractMap.SimpleEntry<>(
"status",
"available"
)
)
),
configuration
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSch
AdditionalPropertiesWithArrayOfEnums.AdditionalPropertiesList validatedPayload =
AdditionalPropertiesWithArrayOfEnums.AdditionalProperties.validate(
Arrays.asList(
"_abc"
),
configuration
);
Expand Down
10 changes: 10 additions & 0 deletions samples/client/petstore/java/docs/components/schemas/AnimalFarm.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSch
AnimalFarm.AnimalFarmList validatedPayload =
AnimalFarm.AnimalFarm1.validate(
Arrays.asList(
MapMaker.makeMap(
new AbstractMap.SimpleEntry<>(
"className",
"a"
),
new AbstractMap.SimpleEntry<>(
"color",
"a"
)
)
),
configuration
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ ArrayOfArrayOfNumberOnly.ArrayOfArrayOfNumberOnlyMap validatedPayload =
"ArrayArrayNumber",
Arrays.asList(
Arrays.asList(
3.14
1
)
)
)
Expand Down Expand Up @@ -111,7 +111,7 @@ ArrayOfArrayOfNumberOnly.ArrayArrayNumberList validatedPayload =
ArrayOfArrayOfNumberOnly.ArrayArrayNumber.validate(
Arrays.asList(
Arrays.asList(
3.14
1
)
),
configuration
Expand Down Expand Up @@ -172,7 +172,7 @@ static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSch
ArrayOfArrayOfNumberOnly.ItemsList validatedPayload =
ArrayOfArrayOfNumberOnly.Items.validate(
Arrays.asList(
3.14
1
),
configuration
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSch
ArrayOfEnums.ArrayOfEnumsList validatedPayload =
ArrayOfEnums.ArrayOfEnums1.validate(
Arrays.asList(
(Void) null
),
configuration
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ ArrayOfNumberOnly.ArrayOfNumberOnlyMap validatedPayload =
new AbstractMap.SimpleEntry<>(
"ArrayNumber",
Arrays.asList(
3.14
1
)
)
),
Expand Down Expand Up @@ -106,7 +106,7 @@ static final SchemaConfiguration configuration = new SchemaConfiguration(JsonSch
ArrayOfNumberOnly.ArrayNumberList validatedPayload =
ArrayOfNumberOnly.ArrayNumber.validate(
Arrays.asList(
3.14
1
),
configuration
);
Expand Down
Loading