Skip to content

Commit 17b64e5

Browse files
committed
Rename "golden-master" to "golden-record" and update developer commands / documentation / metadata
1 parent c0fd042 commit 17b64e5

36 files changed

+159
-190
lines changed

.run/pytest.run.xml

Lines changed: 0 additions & 19 deletions
This file was deleted.

.run/run_fastapi.run.xml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.run/tests.test_end_to_end.regen_golden_master.run.xml

Lines changed: 0 additions & 34 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 75 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,156 +1,185 @@
11
# Changelog
2+
23
All notable changes to this project will be documented in this file.
34

45
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
56
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
67

78
## 0.6.0 - Unreleased
9+
810
### Breaking Changes
9-
- Reorganized api calls in generated clients. `async_api` will no longer be generated. Each path operation will now
10-
have it's own module under its tag. For example, if there was a generated function `api.my_tag.my_function()` it is
11-
replaced with `api.my_tag.my_function.sync()`. The async version can be called with `asyncio()` instead of `sync()`.
12-
(#167)
13-
- Removed support for mutable default values (e.g. dicts, lists). They may be added back in a future version given enough
14-
demand, but the existing implementation was not up to this project's standards. (#170)
15-
- Removed generated `errors` module (and the `ApiResponseError` therein). Instead of raising an exception on failure,
16-
the `sync()` and `asyncio()` functions for a path operation will return `None`. This means all return types are now
11+
12+
- Reorganized api calls in generated clients. `async_api` will no longer be generated. Each path operation will now
13+
have it's own module under its tag. For example, if there was a generated function `api.my_tag.my_function()` it is
14+
replaced with `api.my_tag.my_function.sync()`. The async version can be called with `asyncio()` instead of `sync()`.
15+
(#167)
16+
- Removed support for mutable default values (e.g. dicts, lists). They may be added back in a future version given enough
17+
demand, but the existing implementation was not up to this project's standards. (#170)
18+
- Removed generated `errors` module (and the `ApiResponseError` therein). Instead of raising an exception on failure,
19+
the `sync()` and `asyncio()` functions for a path operation will return `None`. This means all return types are now
1720
`Optional`, so mypy will require you to handle potential errors (or explicitly ignore them).
1821
- Moved `models.types` generated module up a level, so just `types`.
1922
- `Client` and `AuthenticatedClient` are now declared using the `attrs` package instead of builtin `dataclass`
2023

2124
### Additions
22-
- Every generated API module will have a `sync_detailed()` and `asyncio_detailed()` function which work like their
25+
26+
- Every generated API module will have a `sync_detailed()` and `asyncio_detailed()` function which work like their
2327
non-detailed counterparts, but return a `types.Response[T]` instead of an `Optional[T]` (where T is the parsed body type).
24-
`types.Response` contains `status_code`, `content` (bytes of returned content), `headers`, and `parsed` (the
28+
`types.Response` contains `status_code`, `content` (bytes of returned content), `headers`, and `parsed` (the
2529
parsed return type you would get from the non-detailed function). (#115)
26-
- It's now possible to include custom headers and cookies in requests, as well as set a custom timeout. This can be done
27-
either by directly setting those parameters on a `Client` (e.g. `my_client.headers = {"Header": "Value"}`) or using
28-
a fluid api (e.g. `my_endpoint.sync(my_client.with_cookies({"MyCookie": "cookie"}).with_timeout(10.0))`).
29-
30+
- It's now possible to include custom headers and cookies in requests, as well as set a custom timeout. This can be done
31+
either by directly setting those parameters on a `Client` (e.g. `my_client.headers = {"Header": "Value"}`) or using
32+
a fluid api (e.g. `my_endpoint.sync(my_client.with_cookies({"MyCookie": "cookie"}).with_timeout(10.0))`).
3033

3134
## 0.5.4 - 2020-08-29
35+
3236
### Additions
37+
3338
- Support for octet-stream content type (#116)
3439
- Support for [nullable](https://swagger.io/docs/specification/data-models/data-types/#null) (#99)
3540
- Union properties can be defined using oneOf (#98)
3641
- Support for lists of strings, integers, floats and booleans as responses (#165). Thanks @Maistho!
3742

38-
3943
## 0.5.3 - 2020-08-13
44+
4045
### Security
46+
4147
- All values that become file/directory names are sanitized to address path traversal vulnerabilities (CVE-2020-15141)
4248
- All values that get placed into python files (everything from enum names, to endpoint descriptions, to default values) are validated and/or saniziatied to address arbitrary code execution vulnerabilities (CVE-2020-15142)
4349

4450
### Changes
51+
4552
- Due to security concerns/implementation complexities, default values are temporarily unsupported for any `RefProperty` that doesn't refer to an enum.
46-
- Defaults for properties must now be valid values for their respective type (e.g. "example string" is an invalid default for an `integer` type property, and the function for an endpoint using it would fail to generate and be skipped).
53+
- Defaults for properties must now be valid values for their respective type (e.g. "example string" is an invalid default for an `integer` type property, and the function for an endpoint using it would fail to generate and be skipped).
4754

4855
### Additions
56+
4957
- Added support for header parameters (#117)
5058

5159
### Fixes
52-
- JSON bodies will now be assigned correctly in generated clients(#139 & #147). Thanks @pawamoy!
5360

61+
- JSON bodies will now be assigned correctly in generated clients(#139 & #147). Thanks @pawamoy!
5462

5563
## 0.5.2 - 2020-08-06
64+
5665
### Additions
66+
5767
- Added `project_name_override` and `package_name_override` config options to override the name of the generated project/package (#123)
5868
- The generated library's version is now the same as the OpenAPI doc's version (#134)
5969

60-
6170
## 0.5.1 - 2020-08-05
71+
6272
### Fixes
73+
6374
- Relative paths are now allowed in securitySchemes/OAuthFlow/tokenUrl (#130).
6475
- Schema validation errors will no longer print a stack trace (#131).
6576
- Invalid YAML/URL will no longer print stack trace (#128)
6677

67-
6878
## 0.5.0 - 2020-08-05
79+
6980
### Changes
81+
7082
- When encountering a problem, the generator will now differentiate between warnings (things it was able to skip past)
71-
and errors (things which halt generation altogether).
83+
and errors (things which halt generation altogether).
7284

7385
### Additions
86+
7487
- The generator can now handle many more errors gracefully, skipping the things it can't generate and continuing
75-
with the pieces it can.
88+
with the pieces it can.
7689
- Support for Enums declared in "components/schemas" and references to them (#102).
7790
- Generated clients can now be installed via pip (#120).
7891
- Support for YAML OpenAPI documents (#111)
79-
92+
8093
### Internal Changes
81-
- Switched OpenAPI document parsing to use Pydantic based on a vendored version of
82-
[openapi-schema-pydantic](https://github.com/kuimono/openapi-schema-pydantic/) (#103).
83-
- Tests can now be run on Windows.
8494

95+
- Switched OpenAPI document parsing to use Pydantic based on a vendored version of
96+
[openapi-schema-pydantic](https://github.com/kuimono/openapi-schema-pydantic/) (#103).
97+
- Tests can now be run on Windows.
8598

8699
## 0.4.2 - 2020-06-13
100+
87101
### Additions
102+
88103
- Support for responses with no content (#63 & #66). Thanks @acgray!
89104
- Support for custom string formats (#64 & #65). Thanks @acgray!
90105

91-
92106
## 0.4.1 - 2020-06-02
107+
93108
### Additions
94-
- Support for Python 3.7 (#58)
95109

110+
- Support for Python 3.7 (#58)
96111

97112
## 0.4.0 - 2020-05-30
113+
98114
### Breaking Changes
99-
- Classes generated to be included within lists will now be named like <ListName>Item. For example, if a property
100-
named "statuses" is an array of enum values, previously the `Enum` class declared would be called "Statuses". Now it
101-
will be called "StatusesItem". If a "title" attribute was used in the OpenAPI document, that should still be respected
102-
and used instead of the generated name. You can restore previous names by adding "StatusesItem" to the `class_overrides`
103-
section of a config file.
115+
116+
- Classes generated to be included within lists will now be named like <ListName>Item. For example, if a property
117+
named "statuses" is an array of enum values, previously the `Enum` class declared would be called "Statuses". Now it
118+
will be called "StatusesItem". If a "title" attribute was used in the OpenAPI document, that should still be respected
119+
and used instead of the generated name. You can restore previous names by adding "StatusesItem" to the `class_overrides`
120+
section of a config file.
104121
- Clients now require httpx ^0.13.0 (up from ^0.12.1). See [httpx release notes](https://github.com/encode/httpx/releases/tag/0.13.0)
105-
for details.
122+
for details.
106123

107124
### Additions
125+
108126
- Support for binary format strings (file payloads)
109127
- Support for multipart/form bodies
110128
- Support for any supported property within a list (array), including other lists.
111129
- Support for Union types ("anyOf" in OpenAPI document)
112130
- Support for more basic response types (integer, number, boolean)
113-
- Support for duplicate enums. Instead of erroring, enums with the same name (title) but differing values
114-
will have a number appended to the end. So if you have two conflicting enums named `MyEnum`, one of them
115-
will now be named `MyEnum1`. Note that the order in which these are processed and therefore named is entirely
116-
dependent on the order they are read from the OpenAPI document, so changes to the document could result
117-
in swapping the names of conflicting Enums.
131+
- Support for duplicate enums. Instead of erroring, enums with the same name (title) but differing values
132+
will have a number appended to the end. So if you have two conflicting enums named `MyEnum`, one of them
133+
will now be named `MyEnum1`. Note that the order in which these are processed and therefore named is entirely
134+
dependent on the order they are read from the OpenAPI document, so changes to the document could result
135+
in swapping the names of conflicting Enums.
118136

119137
### Changes
120-
- The way most imports are handled was changed which *should* lead to fewer unused imports in generated files.
138+
139+
- The way most imports are handled was changed which _should_ lead to fewer unused imports in generated files.
121140
- Better error messages
122-
- Most error messages will contain some useful information about why it failed instead of a stack trace
123-
- Client will still be generated if there are recoverable errors, excluding endpoints that had those errors
141+
- Most error messages will contain some useful information about why it failed instead of a stack trace
142+
- Client will still be generated if there are recoverable errors, excluding endpoints that had those errors
124143
- Output from isort and black when generating will now be suppressed
125144

126145
### Fixes
127-
- Defaults within models dataclasses for `Dict` or `List` properties will now be properly declared as a
128-
`field` with the `default_factory` parameter to prevent errors related to mutable defaults.
146+
147+
- Defaults within models dataclasses for `Dict` or `List` properties will now be properly declared as a
148+
`field` with the `default_factory` parameter to prevent errors related to mutable defaults.
129149

130150
## 0.3.0 - 2020-04-25
151+
131152
### Additions
153+
132154
- Link to the GitHub repository from PyPI (#26). Thanks @theY4Kman!
133155
- Support for date properties (#30, #37). Thanks @acgray!
134156
- Allow naming schemas by property name and Enums by title (#21, #31, #38). Thanks @acgray!
135157

136158
### Fixes
159+
137160
- Fixed some typing issues in generated clients and incorporate mypy into end to end tests (#32). Thanks @acgray!
138161
- Properly handle camelCase endpoint names and properties (#29, #36). Thanks @acgray!
139162

140163
## 0.2.1 - 2020-03-22
164+
141165
### Fixes
166+
142167
- Fixed import of errors.py in generated api modules
143168

144169
### Additions
170+
145171
- Support for lists of Enums
146172
- Add config for black to generated pyproject.toml
147173

148174
## 0.2.0 - 2020-03-22
175+
149176
### Changes
177+
150178
- Update Typer dependency to 0.1.0 and remove click-completion dependency (#19)
151179
- Switched to httpx from requests for both this tool and generated clients (#15)
152180

153181
### Additions
182+
154183
- `--version` option to print the version of openapi-python-client and exit
155184
- `--config` option for passing a config.yml file to override generated class names (#9)
156185
- Generated clients will now have some basic Poetry usage in their README.md (#13)
@@ -160,15 +189,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
160189
- A number of additions to the README including recommending pipx (#20)
161190

162191
## 0.1.2 - 2020-03-16
192+
163193
- Improve handling of optional properties in generated `to_dict` function for models
164194
- Add PEP 561 marker file (py.typed) to generated packages
165195

166196
## 0.1.1 - 2020-03-06
197+
167198
- Fix mypy issue in generated models `from_dict` with datetime or reference properties
168199
- Generated clients now raise an `ApiResponseError` if they receive a response that was not declared
169200
- Stop including optional query parameters when value is set to None
170201
- Added an `update` command to update a previously generated client
171202
- Added click-completion for installable tab completion in most shells
172203

173204
## 0.1.0 - 2020-02-28
205+
174206
- Initial Release

0 commit comments

Comments
 (0)