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

Commit f2e5cf0

Browse files
committed
v3 updates docs to correctly describe shemas + schema.validate input + output types (#200)
* Removes incorrect lingering suffixes on format functions * Adds object input and ouput types in schema docs * Adds anchor to XDictInput in schema type * Adds output type anchor * Adds separate object input and output types * Adds invalid identifier note * Adds schemas.Unset accessed type object optional properties output type * Adds optional unset input type * Adds unset return value for object additional property, adds note about get_additional_property_ * Writes items input and output types * Adds Array model input type * Adds array output type * Changes Type Info to vaidate method * Creates and uses md io template * Adds index field to array schema docs * Adds new and from_dict_ methods to docs * Adds properties section * Fixes getitem documentation * Moves from_dict_ method later and adds self input * Adds base class info to object output class * Adds inputt type for object input class * Adds array input type * Adds array output type * Fixes addprops types * Puts object output types in code blocks * Adds object input and output type for anyType validate input * For anyType output types, lists object and array output class links * Fixes from_dict_ input and output types for anytype * Changes array input type to use io template * Removes properties from identiferPieces * Adds shared array and object output type templates * Uses output types for object properties * Adds unset to io template * Adds new and get_item docs for array output type * Writes doc for each header schema * Writes content schema docs * Writes parameter schemas * Writes doc for response header object schema * Removes collection schema doc files for header/query/path/cookie params * Updates schema ref info presentation * Uses io template for object input docs * Adds docRoot to to all payloads passed in to handlebars that render schema_docs with a partial * Adds docRoot passing to all locations that produce schema_doc * Removes inline schema locations * Fixes ref types for object input values * Adds module prefix to refed type if it is object or array * Adds missing docRoot * Labels schema types * Moves templates into types folder * Further type refactoring * Adds more refactoring * Removes helper prefixes from two templates * Moves schema_io_type templates * Moves more templates into types folder * Moves 3 files into types * Renames template because it is only used by schema doc * Moves the last type template into the types folder * Merges two templates * Removes redundant template * Consolidates validate method templates * Consolidates schema_cls templates * More schema template renaming * Moves another template into schema_cls * Reorganizes schema templates * Fixes composed schema anchors in schema docs * Adds refModule to schema class name for composed schemas in docs * Uses schemadoc templates for composed schema docs, removes descr and notes * Removes usages of complexTypePrefix * Removes setting complexTypePrefix in java payloads * Adds string enum literal to io and output types in docs * Adds int literals to schema docs * Adds bool literal * Uses typing instead of typing_extensions because python v3.8 is used * Updates ArrayInput items description * Fixes docRoot values * Fixes detection of self references in schema docs for output types * Fixes io detection of elf references * Removes unused imports * Adds inline schema types ot operation docs * Adds ref request body schema types * Lists all possible content-types in operations * Adds query params description using schema doc * Updates header parameters * Updates allowed content type listing * Adds path parameter docs using schema docs * Updates cookie param docs * Changes response_cls name to ApiResponse * Fixes response docs * FIxes build errors and java errors * Samples regen
1 parent 46f6981 commit f2e5cf0

File tree

1,436 files changed

+24392
-10338
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,436 files changed

+24392
-10338
lines changed

samples/client/3_0_3_unit_test/python/.openapi-generator/FILES

+174
Large diffs are not rendered by default.

samples/client/3_0_3_unit_test/python/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ N schemas can be validated on the same payload.
112112
To allow multiple schemas to validate, the data must be stored using one base class whether or not
113113
a json schema format constraint exists in the schema.
114114
See te below accessors for string data:
115-
- type string + format: See .as_date_, .as_datetime_, .as_decimal_, .as_uuid_
115+
- type string + format: See .as_date, .as_datetime, .as_decimal, .as_uuid
116116

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

137137
## Getting Started
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,28 @@
1+
# _Not
12
unit_test_api.components.schema._not
2-
# Schema _Not
3+
```
4+
type: schemas.Schema
5+
```
36

4-
## Type Info
5-
Input Type | Accessed Type | Description | Notes
6-
------------ | ------------- | ------------- | -------------
7-
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 | |
7+
## validate method
8+
Input Type | Return Type | Notes
9+
------------ | ------------- | -------------
10+
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 |
811

912
## Composed Schemas (allOf/anyOf/oneOf/not)
1013
## not
11-
Class Name | Input Type | Accessed Type | Description | Notes
12-
------------- | ------------- | ------------- | ------------- | -------------
13-
[_not](#not2) | int | int | |
14+
Schema Class | Input Type | Return Type
15+
------------ | ---------- | -----------
16+
[Not2](#not2) | int | int
1417

1518
# Not2
19+
```
20+
type: schemas.Schema
21+
```
1622

17-
## Type Info
18-
Input Type | Accessed Type | Description | Notes
19-
------------ | ------------- | ------------- | -------------
20-
int | int | |
23+
## validate method
24+
Input Type | Return Type | Notes
25+
------------ | ------------- | -------------
26+
int | int |
2127

2228
[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md)
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,59 @@
1+
# AdditionalpropertiesAllowsASchemaWhichShouldValidate
12
unit_test_api.components.schema.additionalproperties_allows_a_schema_which_should_validate
2-
# Schema AdditionalpropertiesAllowsASchemaWhichShouldValidate
3+
```
4+
type: schemas.Schema
5+
```
36

4-
## Type Info
5-
Input Type | Accessed Type | Description | Notes
7+
## validate method
8+
Input Type | Return Type | Notes
9+
------------ | ------------- | -------------
10+
[AdditionalpropertiesAllowsASchemaWhichShouldValidateDictInput](#additionalpropertiesallowsaschemawhichshouldvalidatedictinput), [AdditionalpropertiesAllowsASchemaWhichShouldValidateDict](#additionalpropertiesallowsaschemawhichshouldvalidatedict) | [AdditionalpropertiesAllowsASchemaWhichShouldValidateDict](#additionalpropertiesallowsaschemawhichshouldvalidatedict) |
11+
12+
## AdditionalpropertiesAllowsASchemaWhichShouldValidateDictInput
13+
```
14+
type: typing.Mapping[
15+
str,
16+
typing.Union[
17+
typing.Union[
18+
schemas.INPUT_TYPES_ALL,
19+
schemas.OUTPUT_BASE_TYPES
20+
],
21+
typing.Union[
22+
schemas.INPUT_TYPES_ALL,
23+
schemas.OUTPUT_BASE_TYPES
24+
],
25+
bool,
26+
]
27+
]
28+
```
29+
Key | Type | Description | Notes
630
------------ | ------------- | ------------- | -------------
7-
dict, schemas.immutabledict | schemas.immutabledict | |
31+
**foo** | dict, schemas.immutabledict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | | [optional]
32+
**bar** | dict, schemas.immutabledict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | | [optional]
33+
**any_string_name** | bool | any string name can be used but the value must be the correct type | [optional]
34+
35+
## AdditionalpropertiesAllowsASchemaWhichShouldValidateDict
36+
```
37+
base class: schemas.immutabledict[str, bool]
38+
39+
```
40+
### &lowbar;&lowbar;new&lowbar;&lowbar; method
41+
Keyword Argument | Type | Description | Notes
42+
---------------- | ---- | ----------- | -----
43+
**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]
44+
**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]
45+
**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
46+
47+
### properties
48+
Property | Type | Description | Notes
49+
-------- | ---- | ----------- | -----
50+
**foo** | schemas.immutabledict, str, float, int, bool, None, tuple, bytes, io.FileIO, schemas.Unset | | [optional]
51+
**bar** | schemas.immutabledict, str, float, int, bool, None, tuple, bytes, io.FileIO, schemas.Unset | | [optional]
852

9-
## Dictionary Keys
10-
Key | Input Type | Accessed Type | Description | Notes
11-
------------ | ------------- | ------------- | ------------- | -------------
12-
**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]
13-
**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]
14-
**any_string_name** | bool | bool | any string name can be used but the value must be the correct type | [optional]
53+
### methods
54+
Method | Input Type | Return Type | Notes
55+
------ | ---------- | ----------- | ------
56+
from_dict_ | [AdditionalpropertiesAllowsASchemaWhichShouldValidateDictInput](#additionalpropertiesallowsaschemawhichshouldvalidatedictinput), [AdditionalpropertiesAllowsASchemaWhichShouldValidateDict](#additionalpropertiesallowsaschemawhichshouldvalidatedict) | [AdditionalpropertiesAllowsASchemaWhichShouldValidateDict](#additionalpropertiesallowsaschemawhichshouldvalidatedict) | a constructor
57+
get_additional_property_ | str | bool, schemas.Unset | provides type safety for additional properties
1558

1659
[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md)
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,46 @@
1+
# AdditionalpropertiesAreAllowedByDefault
12
unit_test_api.components.schema.additionalproperties_are_allowed_by_default
2-
# Schema AdditionalpropertiesAreAllowedByDefault
3+
```
4+
type: schemas.Schema
5+
```
36

4-
## Type Info
5-
Input Type | Accessed Type | Description | Notes
7+
## validate method
8+
Input Type | Return Type | Notes
9+
------------ | ------------- | -------------
10+
[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 |
11+
12+
## AdditionalpropertiesAreAllowedByDefaultDictInput
13+
```
14+
type: typing.Mapping[str, schemas.INPUT_TYPES_ALL]
15+
```
16+
Key | Type | Description | Notes
617
------------ | ------------- | ------------- | -------------
7-
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 | |
18+
**foo** | dict, schemas.immutabledict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | | [optional]
19+
**bar** | dict, schemas.immutabledict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | | [optional]
20+
**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]
21+
22+
## AdditionalpropertiesAreAllowedByDefaultDict
23+
```
24+
base class: schemas.immutabledict[str, schemas.OUTPUT_BASE_TYPES]
25+
26+
```
27+
### &lowbar;&lowbar;new&lowbar;&lowbar; method
28+
Keyword Argument | Type | Description | Notes
29+
---------------- | ---- | ----------- | -----
30+
**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]
31+
**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]
32+
**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
33+
34+
### properties
35+
Property | Type | Description | Notes
36+
-------- | ---- | ----------- | -----
37+
**foo** | schemas.immutabledict, str, float, int, bool, None, tuple, bytes, io.FileIO, schemas.Unset | | [optional]
38+
**bar** | schemas.immutabledict, str, float, int, bool, None, tuple, bytes, io.FileIO, schemas.Unset | | [optional]
839

9-
## Dictionary Keys
10-
Key | Input Type | Accessed Type | Description | Notes
11-
------------ | ------------- | ------------- | ------------- | -------------
12-
**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]
13-
**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]
14-
**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]
40+
### methods
41+
Method | Input Type | Return Type | Notes
42+
------ | ---------- | ----------- | ------
43+
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
44+
get_additional_property_ | str | schemas.immutabledict, tuple, float, int, str, bool, None, bytes, schemas.FileIO, schemas.Unset }} | provides type safety for additional properties
1545

1646
[[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md)
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,39 @@
1+
# AdditionalpropertiesCanExistByItself
12
unit_test_api.components.schema.additionalproperties_can_exist_by_itself
2-
# Schema AdditionalpropertiesCanExistByItself
3+
```
4+
type: schemas.Schema
5+
```
36

4-
## Type Info
5-
Input Type | Accessed Type | Description | Notes
7+
## validate method
8+
Input Type | Return Type | Notes
9+
------------ | ------------- | -------------
10+
[AdditionalpropertiesCanExistByItselfDictInput](#additionalpropertiescanexistbyitselfdictinput), [AdditionalpropertiesCanExistByItselfDict](#additionalpropertiescanexistbyitselfdict) | [AdditionalpropertiesCanExistByItselfDict](#additionalpropertiescanexistbyitselfdict) |
11+
12+
## AdditionalpropertiesCanExistByItselfDictInput
13+
```
14+
type: typing.Mapping[
15+
str,
16+
bool,
17+
]
18+
```
19+
Key | Type | Description | Notes
620
------------ | ------------- | ------------- | -------------
7-
dict, schemas.immutabledict | schemas.immutabledict | |
21+
**any_string_name** | bool | any string name can be used but the value must be the correct type | [optional]
22+
23+
## AdditionalpropertiesCanExistByItselfDict
24+
```
25+
base class: schemas.immutabledict[str, bool]
26+
27+
```
28+
### &lowbar;&lowbar;new&lowbar;&lowbar; method
29+
Keyword Argument | Type | Description | Notes
30+
---------------- | ---- | ----------- | -----
31+
**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
832

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

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

0 commit comments

Comments
 (0)