* [go] More idiomatic godoc comments
* [go] Mark deprecated fields and functions
* [go] Minor mustache readability/consistency fixes
* [go] Mark deprecated operation parameters
* [go] Deprecate a petstore component property for testing
* [go] Apply deprecated godoc in Go servers also
* [BUG][PYTHON] Do not set Content-Type for GET, HEAD or DELETE requests
The Python generator no longer sets a default `Content-Type` of
`application/json` for `GET`, `HEAD` and `DELETE` requests.
Having the `Content-Type` set for these requests was causing issues with
other tools which insist that GET, HEAD and DELETE requests do not have
a Content-Type (as per the OpenAPI 3 specification).
An example of the problem that this commit fixes is when using
[Prism][1] as a [validation proxy][2].
[Prism rejects any GET request that has a Content-Type][3].
Here is [an example of the problem manifesting itself][4].
To validate the fix in this commit:
1. Start with any OpenAPI3 spec e.g. the Petstore example at
https://editor.swagger.io/
2. Generate Python client code for the spec
3. Look at the generated `rest.py` e.g. in the [standard sample in this
repo][5] and see that the `Content-Type` defaults to `application/json`
for all HTTP methods (including `GET`, `HEAD` and `DELETE`), rather than
there being no `Content-Type` for `GET`, `HEAD` and `DELETE`.
Fixes#9831
[1]: https://github.com/stoplightio/prism
[2]: https://meta.stoplight.io/docs/prism/docs/guides/03-validation-proxy.md
[3]: https://github.com/stoplightio/prism/issues/1408#issuecomment-690948020
[4]: https://github.com/agilepathway/gauge-openapi-example/pull/28/checks?check_run_id=2888606052#step:13:18
[5]: 969cea8ce1/samples/openapi3/client/petstore/python/petstore_api/rest.py (L141)
* update samples
* Fix Python DELETE bug introduced in earlier commit
The earlier commit 9dfe1f6 introduced a bug for `DELETE` requests on the
standard Python generator. This commit fixes that bug and also includes
the updated samples.
Co-authored-by: William Cheng <wing328hk@gmail.com>
* Revert a change to the Go Client code that broke
the ability to download files. This reverts the change
from 14d41310b9
* Missed import for "io/ioutil"
* update samples
Co-authored-by: icubbon <icubbon@gmail.com>
* [python][client] allow passing floats for _request_timeout
While several method docstrings suggested that you could pass floats for
_request_timeout and the underlying urllib3.Timeout can deal with them,
the code only allowed integer values so far when passed as a single
number.
* [python][samples] update with fix for _request_timeout type
* fix by mapping outside of class
* tests
* regeneration and tests
* server
* INDENT
* a
* enable mapping
* Revert "server"
This reverts commit 6fc9712fb550d258d0332df243ea5080565c6770.
* Samples regenerated
Co-authored-by: Justin Black <justin.a.black@gmail.com>
* Fixes additionalProperties values for models, updates docs, adds tag test of it, fixes frit and gmfruit tests
* Moves this.setDisallowAdditionalPropertiesIfNotPresent higher
* Makes setting additional_properties_model_instances contingent on the presence of addprosp in schema, updates sample spec composed schemas to remove addprops False form two
* Fixes oneOf anyOf allOf instantiation logic
* Removes Address from Cat definition
* Adds required vars for apple and banana, removes required vars from composed schema init sig
* Updates composed schema vars to be set on self and all composed instances
* Removes get_unused_args, get_var_name_to_model_instances, and get_additional_properties_model_instances
* Fixes fruit + deserilization tests, creates ComposedSchemaWithPropsAndNoAddProps
* Fixes FruitReq tests
* Fixes GmFruit tests
* Fixes discard_unknown_keys tests
* Samples updated
* Removes additionalproperties False in Child
* Samples updated
* Improves handling of v2 and v3 specs for isFreeFormObject, v2 sample spec updated with link to bug
* Adds cli option disallowAdditionalPropertiesIfNotPresent to python
* Adds getAdditionalProperties method so the value for addProps will be correct
* Reverts file
* Reverts file
* Updates python doc
* Reverted anytype_3 definition
* Updates test_deserialize_lizard
* Updates test_deserialize_dict_str_dog
* Updates testDog
* Updates testChild
* Adds v2 python_composition sample
* Adds needed files for python testing
* Adds existing tests into the new python sample
* Fixes test_dog
* Removes addProps false form Dog
* Fixes testChild
* Updates how additionalProperties are set
* Fixes empty_map type
* Type generation fixed for v2 and v3 specs
* Refactors getTypeString, updates artifactids in pom.xml files
* Adds new python sample to CI testing I think
* Fixes artifactId collision, regenrates docs
* Add a space between table title and the line above it to resolve issues when translating markdown to asciidoc
* Regenerate Samples
Co-authored-by: Tyler Ballast <tyler.ballast@reportix.com>
Co-authored-by: tballast <tyler.ballast@gmail.com>