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

v3 updates docs to correctly describe shemas + schema.validate input + output types #200

Merged
merged 90 commits into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
ca2e395
Removes incorrect lingering suffixes on format functions
spacether Aug 7, 2023
6cfc855
Adds object input and ouput types in schema docs
spacether Aug 7, 2023
19d248a
Adds anchor to XDictInput in schema type
spacether Aug 7, 2023
4b1173f
Adds output type anchor
spacether Aug 7, 2023
0f6ab6f
Adds separate object input and output types
spacether Aug 7, 2023
a502844
Adds invalid identifier note
spacether Aug 7, 2023
e40c156
Adds schemas.Unset accessed type object optional properties output type
spacether Aug 7, 2023
50e73c2
Adds optional unset input type
spacether Aug 8, 2023
bcb72ad
Adds unset return value for object additional property, adds note abo…
spacether Aug 8, 2023
80ad193
Writes items input and output types
spacether Aug 8, 2023
b506812
Adds Array model input type
spacether Aug 8, 2023
8bdd70c
Adds array output type
spacether Aug 8, 2023
a77ec72
Changes Type Info to vaidate method
spacether Aug 8, 2023
ac47299
Creates and uses md io template
spacether Aug 8, 2023
2ce0d83
Adds index field to array schema docs
spacether Aug 8, 2023
c7d89f4
Adds new and from_dict_ methods to docs
spacether Aug 8, 2023
f74964f
Adds properties section
spacether Aug 8, 2023
889fc14
Fixes getitem documentation
spacether Aug 8, 2023
b42be45
Moves from_dict_ method later and adds self input
spacether Aug 8, 2023
eab0f64
Adds base class info to object output class
spacether Aug 8, 2023
1f62eed
Adds inputt type for object input class
spacether Aug 8, 2023
a025faa
Adds array input type
spacether Aug 8, 2023
1e523df
Adds array output type
spacether Aug 8, 2023
d238b90
Fixes addprops
spacether Aug 8, 2023
b395a61
Puts object output types in code blocks
spacether Aug 8, 2023
7325076
Adds object input and output type for anyType validate input
spacether Aug 8, 2023
29030a7
For anyType output types, lists object and array output class links
spacether Aug 8, 2023
b617335
Fixes from_dict_ input and output types for anytype
spacether Aug 8, 2023
e0d71e0
Changes array input type to use io template
spacether Aug 8, 2023
98dcc00
Removes properties from identiferPieces
spacether Aug 8, 2023
a92d258
Adds shared array and object output type templates
spacether Aug 9, 2023
f929b40
Uses output types for object properties
spacether Aug 9, 2023
fdf3eac
Adds unset to io template
spacether Aug 9, 2023
b85cdd2
Adds new and get_item docs for array output type
spacether Aug 9, 2023
5f09735
Writes doc for each header schema
spacether Aug 9, 2023
8d14d37
Writes content schema docs
spacether Aug 9, 2023
c41245e
Writes parameter schemas
spacether Aug 9, 2023
d8346a8
Writes doc for response header object schema
spacether Aug 9, 2023
9ebc819
Removes collection schema doc files for header/query/path/cookie params
spacether Aug 9, 2023
40d69ec
Updates schema ref info presentation
spacether Aug 9, 2023
bd30489
Uses io template for object input docs
spacether Aug 9, 2023
179f77d
Adds docRoot to to all payloads passed in to handlebars that render s…
spacether Aug 9, 2023
e0c6c30
Adds docRoot passing to all locations that produce schema_doc
spacether Aug 9, 2023
e227915
Removes inline schema locations
spacether Aug 9, 2023
c0b1637
Fixes ref types for object input values
spacether Aug 9, 2023
750881e
Adds module prefix to refed type if it is object or array
spacether Aug 9, 2023
38530e5
Adds missing docRoot
spacether Aug 9, 2023
b1448af
Labels schema types
spacether Aug 9, 2023
4b554f2
Moves templates into types folder
spacether Aug 9, 2023
ababc2e
Further type refactoring
spacether Aug 9, 2023
5126d2a
Adds more refactoring
spacether Aug 9, 2023
4ff9443
Removes helper prefixes from two templates
spacether Aug 9, 2023
6e8b98b
Moves schema_io_type templates
spacether Aug 10, 2023
39b5879
Moves more templates into types folder
spacether Aug 10, 2023
33f0821
Moves 3 files into types
spacether Aug 10, 2023
1bb6437
Renames template because it is only used by schema doc
spacether Aug 10, 2023
bdfb54a
Moves the last type template into the types folder
spacether Aug 10, 2023
4b0ac15
Merges two templates
spacether Aug 10, 2023
8a8b330
Removes redundant template
spacether Aug 10, 2023
016ad39
Consolidates validate method templates
spacether Aug 10, 2023
3e05923
Consolidates schema_cls templates
spacether Aug 10, 2023
1703e79
More schema template renaming
spacether Aug 10, 2023
c870ce1
Moves another template into schema_cls
spacether Aug 10, 2023
8dfcbd7
Reorganizes schema templates
spacether Aug 10, 2023
d9bcd75
Fixes composed schema anchors in schema docs
spacether Aug 10, 2023
d4b67c7
Adds refModule to schema class name for composed schemas in docs
spacether Aug 10, 2023
5f89c08
Uses schemadoc templates for composed schema docs, removes descr and …
spacether Aug 10, 2023
131468c
Removes usages of complexTypePrefix
spacether Aug 10, 2023
6b603ae
Removes setting complexTypePrefix in java payloads
spacether Aug 10, 2023
e620459
Adds string enum literal to io and output types in docs
spacether Aug 10, 2023
2cac483
Adds int literals to schema docs
spacether Aug 10, 2023
eed10a8
Adds bool literal
spacether Aug 10, 2023
5e7bb17
Uses typing instead of typing_extensions because python v3.8 is used
spacether Aug 10, 2023
36fa0a2
Updates ArrayInput items description
spacether Aug 10, 2023
ecbc7f9
Fixes docRoot values
spacether Aug 11, 2023
09ed9ca
Fixes detection of self references in schema docs for output types
spacether Aug 11, 2023
0cd16f3
Fixes io detection of elf references
spacether Aug 11, 2023
0c89f2a
Removes unused imports
spacether Aug 14, 2023
7532e7f
Adds inline schema types ot operation docs
spacether Aug 14, 2023
3a0d0f7
Adds ref request body schema types
spacether Aug 14, 2023
b05223a
Lists all possible content-types in operations
spacether Aug 14, 2023
40eeada
Adds query params description using schema doc
spacether Aug 14, 2023
f9b10b3
Updates header parameters
spacether Aug 14, 2023
f1677fa
Updates allowed content type listing
spacether Aug 14, 2023
2da20a6
Adds path parameter docs using schema docs
spacether Aug 14, 2023
e0fd91f
Updates cookie param docs
spacether Aug 14, 2023
4aa4d8d
Changes response_cls name to ApiResponse
spacether Aug 14, 2023
ee67569
Fixes response docs
spacether Aug 15, 2023
9e3dc57
FIxes build errors and java errors
spacether Aug 15, 2023
78f0d60
Samples regen
spacether Aug 15, 2023
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
  •  
  •  
  •  
174 changes: 174 additions & 0 deletions samples/client/3_0_3_unit_test/python/.openapi-generator/FILES

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions samples/client/3_0_3_unit_test/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ N schemas can be validated on the same payload.
To allow multiple schemas to validate, the data must be stored using one base class whether or not
a json schema format constraint exists in the schema.
See te below accessors for string data:
- type string + format: See .as_date_, .as_datetime_, .as_decimal_, .as_uuid_
- type string + format: See .as_date, .as_datetime, .as_decimal, .as_uuid

In json schema, type: number with no format validates both integers and floats,
so int and float values are stored for type number.
Expand All @@ -131,7 +131,7 @@ For example the string payload '2023-12-20' is validates to both of these schema
format: date
```
Because of use cases like this, a datetime.date is allowed as an input to this schema, but the data
is stored as a string, with a date accessor, instance.as_date_
is stored as a string, with a date accessor, instance.as_date
</details>

## Getting Started
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
# _Not
unit_test_api.components.schema._not
# Schema _Not
```
type: schemas.Schema
```

## Type Info
Input Type | Accessed Type | Description | Notes
------------ | ------------- | ------------- | -------------
dict, schemas.immutabledict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | schemas.immutabledict, str, float, int, bool, None, tuple, bytes, io.FileIO | |
## validate method
Input Type | Return Type | Notes
------------ | ------------- | -------------
dict, schemas.immutabledict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | schemas.immutabledict, str, float, int, bool, None, tuple, bytes, io.FileIO |

## Composed Schemas (allOf/anyOf/oneOf/not)
## not
Class Name | Input Type | Accessed Type | Description | Notes
------------- | ------------- | ------------- | ------------- | -------------
[_not](#not2) | int | int | |
Schema Class | Input Type | Return Type
------------ | ---------- | -----------
[Not2](#not2) | int | int

# Not2
```
type: schemas.Schema
```

## Type Info
Input Type | Accessed Type | Description | Notes
------------ | ------------- | ------------- | -------------
int | int | |
## validate method
Input Type | Return Type | Notes
------------ | ------------- | -------------
int | int |

[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md)
Original file line number Diff line number Diff line change
@@ -1,16 +1,59 @@
# AdditionalpropertiesAllowsASchemaWhichShouldValidate
unit_test_api.components.schema.additionalproperties_allows_a_schema_which_should_validate
# Schema AdditionalpropertiesAllowsASchemaWhichShouldValidate
```
type: schemas.Schema
```

## Type Info
Input Type | Accessed Type | Description | Notes
## validate method
Input Type | Return Type | Notes
------------ | ------------- | -------------
[AdditionalpropertiesAllowsASchemaWhichShouldValidateDictInput](#additionalpropertiesallowsaschemawhichshouldvalidatedictinput), [AdditionalpropertiesAllowsASchemaWhichShouldValidateDict](#additionalpropertiesallowsaschemawhichshouldvalidatedict) | [AdditionalpropertiesAllowsASchemaWhichShouldValidateDict](#additionalpropertiesallowsaschemawhichshouldvalidatedict) |

## AdditionalpropertiesAllowsASchemaWhichShouldValidateDictInput
```
type: typing.Mapping[
str,
typing.Union[
typing.Union[
schemas.INPUT_TYPES_ALL,
schemas.OUTPUT_BASE_TYPES
],
typing.Union[
schemas.INPUT_TYPES_ALL,
schemas.OUTPUT_BASE_TYPES
],
bool,
]
]
```
Key | Type | Description | Notes
------------ | ------------- | ------------- | -------------
dict, schemas.immutabledict | schemas.immutabledict | |
**foo** | dict, schemas.immutabledict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | | [optional]
**bar** | dict, schemas.immutabledict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | | [optional]
**any_string_name** | bool | any string name can be used but the value must be the correct type | [optional]

## AdditionalpropertiesAllowsASchemaWhichShouldValidateDict
```
base class: schemas.immutabledict[str, bool]

```
### &lowbar;&lowbar;new&lowbar;&lowbar; method
Keyword Argument | Type | Description | Notes
---------------- | ---- | ----------- | -----
**foo** | dict, schemas.immutabledict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset | | [optional]
**bar** | dict, schemas.immutabledict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset | | [optional]
**kwargs** | bool | 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
-------- | ---- | ----------- | -----
**foo** | schemas.immutabledict, str, float, int, bool, None, tuple, bytes, io.FileIO, schemas.Unset | | [optional]
**bar** | schemas.immutabledict, str, float, int, bool, None, tuple, bytes, io.FileIO, schemas.Unset | | [optional]

## Dictionary Keys
Key | Input Type | Accessed Type | Description | Notes
------------ | ------------- | ------------- | ------------- | -------------
**foo** | dict, schemas.immutabledict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | schemas.immutabledict, str, float, int, bool, None, tuple, bytes, io.FileIO | | [optional]
**bar** | dict, schemas.immutabledict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | schemas.immutabledict, str, float, int, bool, None, tuple, bytes, io.FileIO | | [optional]
**any_string_name** | bool | bool | any string name can be used but the value must be the correct type | [optional]
### methods
Method | Input Type | Return Type | Notes
------ | ---------- | ----------- | ------
from_dict_ | [AdditionalpropertiesAllowsASchemaWhichShouldValidateDictInput](#additionalpropertiesallowsaschemawhichshouldvalidatedictinput), [AdditionalpropertiesAllowsASchemaWhichShouldValidateDict](#additionalpropertiesallowsaschemawhichshouldvalidatedict) | [AdditionalpropertiesAllowsASchemaWhichShouldValidateDict](#additionalpropertiesallowsaschemawhichshouldvalidatedict) | a constructor
get_additional_property_ | str | bool, schemas.Unset | provides type safety for additional properties

[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md)
Original file line number Diff line number Diff line change
@@ -1,16 +1,46 @@
# AdditionalpropertiesAreAllowedByDefault
unit_test_api.components.schema.additionalproperties_are_allowed_by_default
# Schema AdditionalpropertiesAreAllowedByDefault
```
type: schemas.Schema
```

## Type Info
Input Type | Accessed Type | Description | Notes
## validate method
Input Type | Return Type | Notes
------------ | ------------- | -------------
[AdditionalpropertiesAreAllowedByDefaultDictInput](#additionalpropertiesareallowedbydefaultdictinput), [AdditionalpropertiesAreAllowedByDefaultDict](#additionalpropertiesareallowedbydefaultdict), str, datetime.date, datetime.datetime, uuid.UUID, int, float, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | [AdditionalpropertiesAreAllowedByDefaultDict](#additionalpropertiesareallowedbydefaultdict), str, float, int, bool, None, tuple, bytes, io.FileIO |

## AdditionalpropertiesAreAllowedByDefaultDictInput
```
type: typing.Mapping[str, schemas.INPUT_TYPES_ALL]
```
Key | Type | Description | Notes
------------ | ------------- | ------------- | -------------
dict, schemas.immutabledict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | schemas.immutabledict, str, float, int, bool, None, tuple, bytes, io.FileIO | |
**foo** | dict, schemas.immutabledict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | | [optional]
**bar** | dict, schemas.immutabledict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | | [optional]
**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]

## AdditionalpropertiesAreAllowedByDefaultDict
```
base class: schemas.immutabledict[str, schemas.OUTPUT_BASE_TYPES]

```
### &lowbar;&lowbar;new&lowbar;&lowbar; method
Keyword Argument | Type | Description | Notes
---------------- | ---- | ----------- | -----
**foo** | dict, schemas.immutabledict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset | | [optional]
**bar** | dict, schemas.immutabledict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, schemas.Unset | | [optional]
**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
-------- | ---- | ----------- | -----
**foo** | schemas.immutabledict, str, float, int, bool, None, tuple, bytes, io.FileIO, schemas.Unset | | [optional]
**bar** | schemas.immutabledict, str, float, int, bool, None, tuple, bytes, io.FileIO, schemas.Unset | | [optional]

## Dictionary Keys
Key | Input Type | Accessed Type | Description | Notes
------------ | ------------- | ------------- | ------------- | -------------
**foo** | dict, schemas.immutabledict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | schemas.immutabledict, str, float, int, bool, None, tuple, bytes, io.FileIO | | [optional]
**bar** | dict, schemas.immutabledict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | schemas.immutabledict, str, float, int, bool, None, tuple, bytes, io.FileIO | | [optional]
**any_string_name** | dict, schemas.immutabledict, list, tuple, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | schemas.immutabledict, tuple, float, int, str, bytes, bool, None, FileIO | any string name can be used but the value must be the correct type | [optional]
### methods
Method | Input Type | Return Type | Notes
------ | ---------- | ----------- | ------
from_dict_ | [AdditionalpropertiesAreAllowedByDefaultDictInput](#additionalpropertiesareallowedbydefaultdictinput), [AdditionalpropertiesAreAllowedByDefaultDict](#additionalpropertiesareallowedbydefaultdict), str, datetime.date, datetime.datetime, uuid.UUID, int, float, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | [AdditionalpropertiesAreAllowedByDefaultDict](#additionalpropertiesareallowedbydefaultdict), str, float, int, bool, None, tuple, bytes, io.FileIO | a constructor
get_additional_property_ | str | schemas.immutabledict, tuple, float, int, str, bool, None, bytes, schemas.FileIO, schemas.Unset }} | provides type safety for additional properties

[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md)
Original file line number Diff line number Diff line change
@@ -1,14 +1,39 @@
# AdditionalpropertiesCanExistByItself
unit_test_api.components.schema.additionalproperties_can_exist_by_itself
# Schema AdditionalpropertiesCanExistByItself
```
type: schemas.Schema
```

## Type Info
Input Type | Accessed Type | Description | Notes
## validate method
Input Type | Return Type | Notes
------------ | ------------- | -------------
[AdditionalpropertiesCanExistByItselfDictInput](#additionalpropertiescanexistbyitselfdictinput), [AdditionalpropertiesCanExistByItselfDict](#additionalpropertiescanexistbyitselfdict) | [AdditionalpropertiesCanExistByItselfDict](#additionalpropertiescanexistbyitselfdict) |

## AdditionalpropertiesCanExistByItselfDictInput
```
type: typing.Mapping[
str,
bool,
]
```
Key | Type | Description | Notes
------------ | ------------- | ------------- | -------------
dict, schemas.immutabledict | schemas.immutabledict | |
**any_string_name** | bool | any string name can be used but the value must be the correct type | [optional]

## AdditionalpropertiesCanExistByItselfDict
```
base class: schemas.immutabledict[str, bool]

```
### &lowbar;&lowbar;new&lowbar;&lowbar; method
Keyword Argument | Type | Description | Notes
---------------- | ---- | ----------- | -----
**kwargs** | bool | 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

## Dictionary Keys
Key | Input Type | Accessed Type | Description | Notes
------------ | ------------- | ------------- | ------------- | -------------
**any_string_name** | bool | bool | any string name can be used but the value must be the correct type | [optional]
### methods
Method | Input Type | Return Type | Notes
------ | ---------- | ----------- | ------
from_dict_ | [AdditionalpropertiesCanExistByItselfDictInput](#additionalpropertiescanexistbyitselfdictinput), [AdditionalpropertiesCanExistByItselfDict](#additionalpropertiescanexistbyitselfdict) | [AdditionalpropertiesCanExistByItselfDict](#additionalpropertiescanexistbyitselfdict) | a constructor
get_additional_property_ | str | bool, schemas.Unset | provides type safety for additional properties

[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md)
Loading