32 Commits

Author SHA1 Message Date
William Cheng
13facdaab5
[python] Add an option to add ensure_ascii=False to json.dumps (#18888)
* Added ensure ascii

* add option to add ensure_ascii=False in jsom.dumps

* remove option

* update workflow

---------

Co-authored-by: Emile Girard <Emile.Girard@opal-rt.com>
2024-06-15 18:39:06 +08:00
William Cheng
2a39b29684
[python] Add field as a reserved word (#18279)
* add field as a reserved word

* remove tabs

* update
2024-04-03 16:43:51 +08:00
Tiffany Marrel
42f72192ca
add security feature AWSV4Signature to documentation (#15603) 2023-12-13 15:07:18 +08:00
William Cheng
ce4b2fe7bd
[Python] add float to reserved word list (#16689)
* add float as reserved world

* clean up

* update samples

* Update modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java

Co-authored-by: Jonathan Ballet <jon@multani.info>

* update doc

* uncomment test

---------

Co-authored-by: Jonathan Ballet <jon@multani.info>
2023-10-01 20:41:54 +08:00
William Cheng
ce4a6a37c6
add oneOf lookup option in python client generator (#16154) 2023-07-22 15:29:04 +08:00
Tiffany Marrel
d7226a6813
[Python] fix security features listed in documentation (#15755) 2023-06-06 10:49:01 +08:00
Tiffany Marrel
00676870a3
add HTTP signature to SecurityFeature (#15542) 2023-05-17 00:48:58 +08:00
William Cheng
01ed5975e1
rename python-nextgen to python (#15504) 2023-05-16 13:54:07 +08:00
William Cheng
0cf5ed619d
Add a new Python client generator - python-nextgen (#14157)
* add python-nextgen generator

* remove client_side_validation from model

* remove configuraiton import from models

* add inheritance support

* update test requirements, tox

* add typings, pydanic to models

* add test model

* minor improvements

* add enum support

* add typing for parameters, remove validations

* add oneof, anyof support

* fix default value

* fix deserialization, api tests passed

* private variable naming, update tests, all tests passed

* remove six

* remove nose

* update doc

* remove sortParamsByRequiredFlag option

* add parameter validation

* add validation tests

* simplify Field()

* remove previous required parameter validation

* improve parameter handling

* support discriminator mapping

* better typing discriminator mapping

* format test code

* fix tests

* fix oneOf from_dict, add test

* add set validation test

* fix nested oneof serialization, add tests

* add model import

* remove models. prefix

* remove import models

* remove model import from api

* simplify from_dict

* add typing for return

* skip pydantic import in return type

* fix tests, fix enum

* restore more enum schema tests

* uncomment enum integer test

* clean up getfullargspec import in model

* clean up getfullargspec import

* fix deserilizatoin for nested oneof

* minor fixes, add tests

* fix regular expression

* add aiohttp samples, add tests

* remove default content type to json

* update template

* fix select accept, content-type

* move tests

* move tests

* fix url query parameters

* fix list

* fix samples

* fix param pydantic, add list as reserved word

* fix auto-generated doc

* fix readme

* fix list, fix special variable name with var_

* fix Literal in python 3.7

* fix default configuration

* fix aiohttp tests

* set default api client instance

* deprecate get_default_copy method

* fix enum model

* fix enum serializatio/deserialization

* add github workflow support

* add regular expression validator

* add enum validator

* better model import

* fix file, remove x-py-import-models

* rename local var

* better model example

* fix regular expression warning, add special_name test, whitelist schema

* skip self import

* update samples

* various fixes

* add base64, json as reserved word

* add http signature support

* add http signature test

* add additioanl properties support in python client

* add decimal support

* use strictstr instead of constr

* fix test with virtualenv

* add nullable support

* add readonly support

* add model name caching

* fix circular reference import

* add onelook discriminator lookup

* add tests

* update samples

* fix locale

* Fix client legacy generator asyncio README code example

* test python-nextgen in circleci

* fix pom.xml

* update python to 3.7.15

* test with python 3.7.12

* various updates

* fix python legacy
2022-12-17 16:05:47 +08:00
Justin Black
57f5cc4000
[python] fixes bugs (#13581)
* Adds bug fixes

* Samples and docs regenerated

* Samples regenerated
2022-10-03 11:15:16 -07:00
Justin Black
7e73645303
Switches python-experimental in as the primary python client (#13501)
* Changes python to python-prior

* python -> python-prior, python-experimental->python

* Renames sample spec directories

* Samples regnerated

* Regenerates docs

* Fixes test

* Samples regenerated

* Updates renerators list

* Fixes made to python paths in pom.xml

* Fixes node4 sh file paths
2022-09-24 16:19:38 +08:00
Justin Black
e2e7609bac
Adds not to CodegenComposedSchemas and uses it in python-exp (#12146)
Updates docs
2022-04-17 09:36:09 -07:00
Justin Black
eef7cddd6f
Adds UUID to python-experimental (#12153)
* Adds UUID to python-exp, allows uuid models to be generated

* Adds test_UUIDString uuid model test

* Fixes uuid properties in python-exp, changes maps to object data type, adds uuid data type

* Adds maps data type back in

* Adds missing Null and AnyType definitions and adds them to python-experimental

* Generator docs updated, added missing uuid, null, anytype, and object

* Adds uuid support description

* Docs updated
2022-04-16 14:55:49 -07:00
Akhil Nair
a6bcef5b16
[PYTHON] Setting default value for Required variables (#10809)
* [req_vars_changes]

* Added new schema to generate samples to test the issue mentioned in the PR.

* Changed the variable name from setRequiredVars to initRequiredVars

* Added initRequiredVars as a generator additional property

* Regenerating the samples after rebasing the code with master branch

* Changed the description of additional property
2022-03-30 08:52:00 -07:00
Justin Black
78f4748c06
Adds generator default template engine (#11366)
* Revert "Revert "Has generators set default template engine (#11245)" (#11316)"

This reverts commit 57987424a4eaa22d73337388489cd86d7f42a023.

* Only loads in the default template engine if the config file contains the generatorName

* Only sets templatingEngineName using condif default in one place

* Adds config files that lack generatorName

* Revert "Adds config files that lack generatorName"

This reverts commit 7dafc93c0f02c037d9be5d2c0a3ee7377c8b479d.

* Adds generator default templating engine to the generator metadata
2022-01-23 14:16:46 -08:00
Justin Black
de036e211e
Improves generator docs: stability + language version added (#11270)
* Adds generatorLanguageVersion and uses it in python generators

* Regenerates docs

* Adds stability to generator docs

* Triple braces generatorLanguageVersion

* Regenerates samples

* Fixes the python-experimental setup.py file so it works with generatorLanguageVersion

* Updates generators readme
2022-01-10 18:16:53 -08:00
Justin Black
0eca629127
Adds generatorLanguage to all generators (#11268)
* Adds generatorLanguage to all generators

* Adds all generator languages and info to docs

* Docs updated
2022-01-10 12:13:35 -08:00
Justin Black
d813d04f46
Improves generator docs, adds metadata section (#11262)
* Refactors generator md creation, adds generateMdMetadata

* Removes extra space

* Adds docs updates

* Fixes table definition for metadata

* Docs update

* Docs update

* Updates title, removes sidebar_label because it was not doing anything on pages like https://openapi-generator.tech/docs/generators/android

* Docs updated
2022-01-09 14:10:47 -08:00
Justin Black
6cc270633b
[python] Fixes additional_properties_type for models (#8802)
* 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
2021-03-31 08:48:12 -07:00
William Cheng
3bf8ca7484
[python] Renames python generators (#7965)
* python->python-legacy, python-experimental->python

* test with openjdk8

* test with openjdk11

* comment out rm

* move kotlin tests to circleci

* move kotlin tests

* move tests to circleci

* fix circleci

* rearrange test

* move tests

* use wrapper

Co-authored-by: Justin Black <justin.a.black@gmail.com>
2020-11-18 14:34:00 +08:00
Jim Schubert
d854c89272
[docs] Add clarity around configuration options (#7547) 2020-09-30 20:56:28 -04:00
William Cheng
596bbb9c58
Add option to set recursion limit (#7491)
* add option to set recursion limit

* fix test failure

* update doc

* add tests

* add missing import

* rename option to recursionLimit
2020-09-24 11:47:22 -07:00
Yuriy Belenko
f11b0f886e
Add Mock Server client modification feature (#6747) 2020-07-05 16:58:43 -04:00
Justin Niessner
db5941379f
[Python] Fix Python UTF-8 Encoding Issue (#5679)
* Try decoding but don't bail on error

* Switch binary and ByteArray to bytes

* Read content type and parse appropriately

* Remove response parsing

* Remove response parsing and just return the data

* Update petshop examples w/ new generator code

* Fix copy/paste error with naming

* Update petstore examples

* Move response decoding to inside _preload_content block

* Update the clients again

* Use a raw string for the regex pattern

* Regenerate petstore clients

* Add bytes to python primitives as it's supported in 2.7 and 3

* Add bytes to the exports from model_utils

* Import bytes from model_utils

* Add conditional typing for regex pattern to match variable type

* Regenerate petstore clients

* Use read() instead of text() for asyncio

* Regenerate petstore clients

* Remove unused six import

* Regenerate petstore clients

* Add newline to kick Circle to re-run

* Remove whitespace from tox.ini

* Update more examples after ensure_updated

* Add sample updates that didn't run with the --batch flag

* Remove extra bracket in regex to remove warning

* Stop printing debug messages

* Add bytes examples to python doc generators

* Update generated FakeApi docs

* Regenerate api_client.py

* Remove print statements from generated clients

* Update bytes example in FakeApi.md. Again. I swear.

* Add yet another seemingly missing doc update

* Catch the error, decode the body, and re-throw

* Remove the updates now that the change is non-breaking

* Regenerate client

* Add bytes deserialization test

* Update exception parsing

* Add exception parsing for python-experimental

* Regenerate client with minor changes

* Revert test changes

* Regenerate model_utils.py

* Update confusing test name

* Remove bytes from mapping and examples

* Add back in the old binary/ByteArray to str mapping

* Update docs and api_client template

* Add experimental api_client changes

* Regenerate samples again

* Add Tornado handling to early return

* Try fixing Tornado python returns

* More documentation changes

* Re-generate the client code

* Remove bytes from test_format_test

* Remove more leftover bytes usages

* Switch bytes validation back to string

* Fix format_test template and regenerate

* Remove unused bytes var

* Remove bytes import from models and regenerate

* Remove bytes import from test_deserialization

* Reduce nested ifs

* Remove byte logic for now

* Regenerate client after latest changes

* Remove another bytes usage

* Regenerate after removing dangling byte string usage

* Reduce the scope of the try/catch in api_client

* Regenerate after try/catch cleanup

* Swap catch for except

* Regenerate Python client after api_client change

* Fix lint error on the generated api_client

* Add binary format test back in w/ string

* Add decoding to python-experimental and regenerate

* Import re into python-experimental api_client

* Ensure file upload json response is utf-8 encoded bytes
2020-04-26 13:33:42 -07:00
Jim Schubert
aa7cd4f5af
[docs] Upgrade to Docusaurus 2 (#5271)
* [docs] Upgrade to Docusaurus 2

Due to formatting issues with Docusaurus 1 and code blocks, and upcoming
4.3 and 5.0 releases, this is an upgrade to have more control over
formatting and other functionality.

This adds behavior to have light/dark themes.

As a consequence of upgrading, columnar format on ul element in
generated generator docs had to be moved to css. This will not impact
users viewing the markdown on GitHub because it didn't display the
column format.

This upgrade should improve syntax highlighting and performance.

* Fix user page layout, choose theme with clear diff colors
2020-02-11 21:22:58 +08:00
Jim Schubert
a496c2011f
[docs] Initial FeatureSet generator documentation (#5188)
* Flatten feature sets for display

* [cli] Add feature set output to config-help

This includes markdown and plain text outputs for config-help.

* [docs] FeatureSet on generator docs
2020-02-01 20:51:55 -05:00
Jim Schubert
644f720db8
[docs] Sorted doc outputs and clean up duplicated CliOptions (#5046)
* [config-help] Sort all outputs

* Remove old/stale generator docs (these have been renamed previously)

* Sort config doc outputs, making it easier to find relevant info

* Fixes cliOptions duplicates

Erlang client/proper improperly set the version option as packageName
(causing duplicate for packageName).

The java and swift option removals are because the options are added in
parent classes, resulting in duplication of the options.

* Add --github-nested-index for generating docs/generators/README.md

* 📝 Regenerate generator docs
2020-01-19 20:19:11 -05:00
Jim Schubert
a2532cc3c5
[doc] full generator details (#4941) 2020-01-08 21:54:05 -05:00
Justin Black
3959530465 [Python] Updates python test framework to pytest (#4765)
* Switches python generators to use pytest, useNose CLI option added if to allow nose to be used instead

* Adds ensure-up-to-date changes

* Adds setup.cfg to python clients so we can configure nose when useNose=true

* Adds fix for python-aiohttp testing, adds files missing from ensure-up-to-date
2019-12-22 14:14:04 +08:00
Jim Schubert
0e1ce6bb63
[docs] Custom template clarifications and other minor enhancements (#4167)
* [docs] Updating docsite outputs to be browsable on Github as well

* Fix links to other files
   Suffix `.md` was needed to make links works

* [docs] Add clarification to differences between customization and templating docs

* [docs] Collapsible side bar, scroll to top, minor enhancements
2019-10-16 18:04:44 -04:00
Jim Schubert
6fe9a52229 [feat][docs][website] Initial docusaurus based site (#1770)
* Iniital docusaurus based site

* Remove error about default local being used by String.format

* Change pinned users to represent global presence rather than alphabetical order pinning

* Include generator indexes in ensure-up-to-date (docusaurus site and /generators/README)

* Add Font Awesome attribution footer

* Remove feature callout until it is completed

* Include NPM try it out section

* Improve "Getting Started" type docs

* Include new custom template documentation

* Updating templating and customization docs

* Add vendor extension docs

* Cleanup templating page(s).

* Move users to yaml file for easy edit.

* travis configuration, and baseUrl mods to image URLs

* [docs] Migrate FAQ, release summary  from wiki

FAQ has been split into multiple smaller documents to better categorize
and allow users to find what they're looking for (in docs folder or in
new website).

Release summary information (versioning strategy and cadence) has been
migrated from the Wiki and clarified a bit.

Also adds copy button for all code snippets in website.

* Copy current contributing/code of conduct to website

* [docs] Creating a new generator
2019-01-18 17:39:33 +08:00
Jérémie Bresson
31149a5a69
Publish documentation for the generators (#932) 2018-08-31 16:00:27 +02:00