Sebastien Rosset
e8f486ba7f
[Python experimental] Readme improvements ( #6031 )
...
* Python experimental readme improvements
* Python experimental readme improvements
* execute scripts in bin directory
2020-04-25 00:10:32 +08:00
Fabian von Feilitzsch
15345e1620
[python] Cleanup ThreadPool with atexit rather than __del__ ( #5094 )
...
* [python] Cleanup ThreadPool with atexit rather than __del__
This removes the `__del__` function from the generated Python client,
and replaces it with a `cleanup` function. When a ThreadPool is created,
the cleanup function is registered with the `atexit` module.
This fixes #5093 , where the API client could hang indefinitely at
garbage collection.
* Update petstore examples
* Test to ensure threadpool is cleaned up
* Docs now encourage using the context manager
* Regenerate docs
* Update samples
2020-01-28 21:58:11 -08:00
Jim Schubert
78bf3adc4a
[core] Initial FeatureSet structures and definitions ( #3614 )
...
[core] Initial FeatureSet structures and definitions
Add default feature set to DefaultCodegen
Initial FeatureSet definitions for:
* ada
* android
* apache2
* asciidoc
* aspnetcore
* avro
* bash
* c
* clojure
* cpp-pistache-server
* cpp-qt5-client
* cpp-qt5-qhttpengine-server
* cpp-restbed-server
* cpp-restsdk
* cpp-tizen
* csharp
* csharp-nancyfx
* csharp-netcore
* cwiki
* dart
* eiffel
* elixir
* elm
* erlang
* flash
* fsharp-functions
* go Client/Server
* graphql-nodejs-express-server
* graphql-schema
* groovy
* haskell
* haskell-http-client
* java
* jmeter
* kotlin
* kotlin vertx
* kotlin-server
* kotlin-spring
* lua
* mysql
* nim
* nodejs
* nodejs-express
* objc
* ocaml
* openapi
* openapi-yaml
* perl
* php
* php-laravel
* php-lumen
* php-silex
* php-slim
* php-symfony
* php-ze-ph
* powershell
* protobuf
* protobuf-schema
* python
* python-aiohttp
* python-blueplanet
* python-experimental
* r
* ror
* ruby
* ruby
* ruby-sinatra
* rust
* scala-akka
* scala-finch
* scala-gatling
* scala-http-client
* scala-lagom
* scala-play
* scalatra
* scalaz
* spring
* static docs
* swift
* typescript
2020-01-11 16:20:47 -05:00
Jim Schubert
376e419d0b
Support models with multi-level hierarchy (via roxspring) ( #4503 )
...
* Example of broken multi-level hierarchy
* Support for multiple levels of hierarchy in model objects
* Support for multiple levels of hierarchy in generators
* Regenerated samples
* Temporarily skip scalaz sample verification, which is having issue with Java version in CI container
* Re-enable scalaz in verify samples
Co-authored-by: Rob Oxspring <roxspring@imapmail.org>
2019-12-27 15:42:32 +08:00
Justin Black
789f1a06f0
[Python] Adds allOf/oneOf/anyOf composed models ( #4446 )
...
* Adds composed model support for allOf oneOf anyOf
* Moves discriminator into discriminator() class method, adds test_deserialize_lizard, adds setting discriminator using allOf schema
2019-12-14 21:18:41 -05:00
Quim Muntal
8f13b88ed9
Support custom git repository ( #3757 )
...
* add gitHost param to GeneratorSettings and related
* parameterize gitHost in READMEs
* parameterize gitHost in go.mod
* parameterize gitHost in git_push
* update petstore samples
* run ./bin/utils/export_docs_generators.sh
* run meta-codehen.sh
* Revert "run meta-codehen.sh"
This reverts commit d6d579f6159186531257cdfdd73b9caf9e9ffeba.
* Revert "run ./bin/utils/export_docs_generators.sh"
This reverts commit 1b81538198d4319fd1b4e97447303e3cc0e8dc99.
* Revert "update petstore samples"
This reverts commit f513add88396707f6991ae2e4920359583ec88f1.
* run ensure-up-to-date
2019-09-03 21:35:49 +08:00
William Cheng
c3535cf9ca
Add test cases to cover different collection formats ( #3640 )
...
* add test cases to cover different collection format
* add space params to retrofit 1.x
* add space params to retrofit 2.x
* rename url to localVarUrl
* fix exception in haskell servant
2019-08-15 11:09:12 +08:00
Sai Giridhar P
6578cef260
[python] : Make example code snippet compilable ( #3148 )
...
* feat(python): Making example compilable
* feat(python): Updating pet project
* feat(python): Updating comments
* feat(documentation): Fixing comments style
* feat(documentation): Updating documentation
* feat(documentation): Fixing comments style
2019-06-28 17:53:25 +08:00
Matthieu Berthomé
ee43cc1520
handle composed schemas in InlineModelResolver ( #2112 )
...
* handle composed schemas in InlineModelResolver
* fix unit test -> TestUtils.parseSpec
* update samples
* fix samples
* update samples
* update samples
* add new files
2019-05-08 10:19:15 +08:00
Justin Black
b67318ef21
Adds spec additionalProperties + nullable examples ( #2405 )
...
* Adds v2 spec additionalproperties examples, adds v3 spec nulllable model example, updates samples
* Remaining samples updates
* Adds csharp generator update to handle models with multilevel parent types, which works for the AdditionalPropertiesObject model, samples updated
2019-03-20 15:31:28 +08:00
William Cheng
2eb99f602a
Add Bearer authentication support to Python client ( #1999 )
...
* add bearer auth support to python
* add bearer auth support to python
* update python oas2 petstore samples
* update samples
* add bearer format
* update php symfony samle
2019-01-30 22:16:53 +08:00
Justin Black
9ec594eec5
[Spec] adds XmlItem model and route for xml testing ( #1883 )
...
* Adds xmlitem model and route, rest-assured Api suffix fix, updates pytest and pytest-cov versions
* Adds python client sample files
* Adds samples update
* Adds rest-assured sample client update
* Adds sample updates in ensure-up-to-date
* Changes rest-assured files back to master version, removes fix for issue #13
* Updates samples
2019-01-26 17:26:38 +08:00
Justin Black
539ec23298
[python-client] Add model default values ( #1776 )
...
* Adds two models to the v2.0 spec, uses examples as defaults in python client
* Adds array default and type_holder_default and type_holder_example tests
* Re-generated python security client with ./bin/security/python-petstore.sh
* Changes comment text, rebased master
* Updates client + server samples
* Adds missing samples updates
* Changes python client to look for true or false with booleans in toDefaultValue
* Changes boolean casting to use Boolean.valueOf
* Adds deserialization fix for python tests
* Changes Mock to namedtuple in python deserialization tests
* Actually remove unittest.mock
2019-01-09 11:18:35 +08:00
Tomasz Prus
89a0ffa66c
feat: [python/asyncio] use ssl argument instead of ssl_context (deprecated from aiohttp>=3.0.0) ( #1724 )
2018-12-21 09:52:27 +08:00
William Cheng
2ef499faf3
[python] Avoid creating unused ThreadPools ( #1387 )
...
* Avoid creating unused ThreadPools
Instead, create ApiClient.pool on first request for .pool property.
avoids spawning n-cpus threads (the default for ThreadPool) at instantiation of every ApiClient
* update doc
* set pool_thread to None
2018-11-08 17:39:20 +08:00
Tomasz Prus
79dacb20a0
fix: python-asyncio/aiohttp with disabled ssl verification ( #891 )
2018-08-24 09:43:32 +08:00
Matthieu Berthomé
84ef98f067
[Python][Client] pure library client package ( #470 )
...
* Python client pure library package
* check onlyPackage CLI option
* run /bin/python-petstore.sh, update the python samples for CI
* onlyPackage local variable instead of classp property
* fix CI: __future__ absolute_import must be first in file
* update samples
* generateSourceCodeOnly
* updated samples
2018-07-16 15:49:08 +08:00
Tomasz Prus
96e86ac03e
update and fix python samples ( #489 )
...
* fix: update petstore samples for python, fix broken tests
* chore: entries for python-asyncio/tornado in gitignore
2018-07-08 15:29:55 +08:00
William Cheng
14c241fbce
Update python default value ( #360 )
...
* update pythong default value
* fix example, update python sample
* update python petstore sample (asyncio, tornado)
2018-05-08 01:23:49 +08:00
Tomasz Prus
d74d2ba031
fix: python clients ( #136 )
...
* fix: python client
* fix: regenerate petstore samples for python-asyncio/tornado
* fix: python-asyncio tests
* fix: python-tornado tests
* chore: update python samples
* fix: enable tests for python-tornado
* fix: discriminator property
* fix: file type
* python: regenerate samples
* fix: define file as generic type
2018-04-21 11:54:40 +08:00
Edward Wells
c6b6249f1c
Fixed Python client docstrings ( #6780 )
...
* Updated api_client and configuration docstrings
ApiClient: Removed host param, added configuration and cookie param
Configuration: Docstrings are only read from the @property decorated
function, not the setter, moved the more descriptive docstrings from the
setters to property functions
* Ran bin/python-petstore.sh
2017-10-23 18:44:37 +08:00
wing328
591149bcb7
Better logic to handle tags with special characters ( #6466 )
...
* better logic to handle tag with special characters
* update test cases
* comment out swift test cases
* restore the swift tests
2017-09-12 11:41:14 +08:00
wing328
443b0f142b
remove ref to SO ( #6209 )
2017-07-29 18:53:08 +08:00
Greg Huang
dafefc06f1
fix issue #6029 ( #6033 )
2017-07-18 14:16:35 +08:00
wing328
fee54157c0
Merge remote-tracking branch 'origin/master' into 2.3.0
2017-06-15 17:14:39 +08:00
wing328
d6c717263c
[Python] add project name to setup.py in python client ( #5836 )
...
* add project name to setup.py in python client
* update python README to use project name
* add cli option project name for python
2017-06-14 00:18:54 +08:00
wing328
424a70bd8c
Merge remote-tracking branch 'origin/master' into 2.3.0
2017-05-26 17:35:36 +08:00
rompic
ef53f08b09
fixed #5692 and regenerated samples ( #5698 )
2017-05-24 23:26:33 +08:00
wing328
e1e5ac4d37
Merge remote-tracking branch 'origin/master' into 2.3.0
2017-05-17 22:00:06 +08:00
Benjamin Douglas
9058099e5b
Add alias type definitions for Java
...
When a spec defines a Model at the top level that is a non-aggretate type (such
as string, number or boolean), it essentially represents an alias for the simple
type. For example, the following spec snippet creates an alias of the boolean
type that for all intents and purposes acts just like a regular boolean.
definitions:
JustABoolean:
type: boolean
This can be modeled in some languages through built-in mechanisms, such as
typedefs in C++. Java, however, just not have a clean way of representing this.
This change introduces an internal mechanism for representing aliases. It
maintains a map in DefaultCodegen that tracks these types of definitions, and
wherever it sees the "JustABoolean" type in the spec, it generates code that
uses the built-in "Boolean" instead.
This functionality currenlty only applies to Java, but could be extended to
other languages later.
The change adds a few examples of this to the fake endpoint spec for testing,
which means all of the samples change as well.
2017-04-17 12:58:31 -07:00
wing328
cf8a9a0de0
Merge remote-tracking branch 'origin/master' into 2.3.0
2017-04-03 14:54:50 +08:00
Paŭlo Ebermann
ce41a343d8
Updating all samples (except feign) ( #5281 )
2017-04-02 17:01:15 +08:00
wing328
ad4de91d92
Merge remote-tracking branch 'origin/master' into 2.3.0
2017-03-30 09:57:07 +08:00
Paŭlo Ebermann
db71d97370
Updating samples after #5232 . ( #5243 )
...
* Updating samples after #5232 .
* Fix tests after #5232 .
* Fix Javascript client tests.
* JaxRS server: set serverPort only when not given from outside.
* Update JaxRS sample creator scripts to fix serverPort.
* Preliminary test fix for JaxRS server generators.
* Updating samples for JaxRS with Jersey1/2.
* Updating JaxRS samples again.
2017-03-30 01:28:53 +08:00
baartosz
8b891be7d7
[Python] remove singleton ( #5012 )
...
* updated tests relying on configuration's singleton
* regenerated samples
* removed singleton from templates
* regenerated samples
* removed broken sample and its test
* reverted accidental change
* regenerated security/ samples
* removed singleton from RESTClientObject
* removed unused Configuration import
* reverted unrelated change
* updated usage examples in api_doc template
2017-03-22 22:25:46 +08:00
wing328
64d0c403d0
[Python] Fix issue with CI due to dependency ( #4716 )
...
* Issue 4637 Fix for ci build (#4643 )
* [Python] update python requirement.txt and use single quote for safe characters (#4702 )
* update python requirement
* update petstore sample
2017-02-05 23:51:35 +08:00
Scott Williams
6e846e7463
Issue 4637 Fix for ci build ( #4643 )
2017-01-25 12:09:33 +08:00
William Cheng
ce899e3776
Merge remote-tracking branch 'origin/master' into 2.3.0
...
Conflicts:
appveyor.yml
modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java
modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractTypeScriptClientCodegen.java
modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java
modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SpringCodegen.java
modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/TypeScriptAngular2ClientCodegen.java
modules/swagger-codegen/src/main/resources/Java/libraries/feign/pom.mustache
modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/pom.mustache
modules/swagger-codegen/src/main/resources/TypeScript-Fetch/api.mustache
modules/swagger-codegen/src/main/resources/go/api.mustache
modules/swagger-codegen/src/main/resources/objc/api-body.mustache
modules/swagger-codegen/src/main/resources/objc/api-header.mustache
modules/swagger-codegen/src/main/resources/typescript-angular2/configuration.mustache
modules/swagger-codegen/src/main/resources/typescript-angular2/tsconfig.mustache
modules/swagger-codegen/src/test/java/io/swagger/codegen/swift/SwiftModelTest.java
modules/swagger-codegen/src/test/java/io/swagger/codegen/swift3/Swift3ModelTest.java
modules/swagger-codegen/src/test/java/io/swagger/codegen/typescript/typescriptangular2/TypeScriptAngular2ModelTest.java
samples/client/petstore-security-test/typescript-angular2/configuration.ts
samples/client/petstore/go/go-petstore/docs/FakeApi.md
samples/client/petstore/go/go-petstore/fake_api.go
samples/client/petstore/go/go-petstore/pet_api.go
samples/client/petstore/java/feign/pom.xml
samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/FakeApi.java
samples/client/petstore/java/feign/src/main/java/io/swagger/client/api/PetApi.java
samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/api/FakeApi.java
samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/RFC3339DateFormat.java
samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Animal.java
samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumTest.java
samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/FormatTest.java
samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java
samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/api/FakeApi.java
samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/JSON.java
samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/FakeApi.java
samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/PetApi.java
samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/FakeApi.java
samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/api/PetApi.java
samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/FakeApi.java
samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/FakeApi.java
samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/PetApi.java
samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.h
samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m
samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.h
samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.m
samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.h
samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.m
samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.h
samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGConfiguration.h
samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.h
samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m
samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.h
samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.m
samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.h
samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.m
samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.h
samples/client/petstore/objc/default/SwaggerClient/Core/SWGConfiguration.h
samples/client/petstore/objc/default/SwaggerClient/Core/SWGJSONResponseSerializer.h
samples/client/petstore/qt5cpp/client/SWGPetApi.h
samples/client/petstore/qt5cpp/client/SWGStoreApi.h
samples/client/petstore/qt5cpp/client/SWGUserApi.h
samples/client/petstore/typescript-angular2/default/configuration.ts
samples/client/petstore/typescript-angular2/npm/README.md
samples/client/petstore/typescript-angular2/npm/configuration.ts
samples/client/petstore/typescript-angular2/npm/package.json
samples/client/petstore/typescript-angular2/npm/tsconfig.json
samples/client/petstore/typescript-fetch/builds/default/api.ts
samples/client/petstore/typescript-fetch/builds/es6-target/api.ts
samples/client/petstore/typescript-fetch/builds/with-npm-version/api.ts
samples/client/petstore/typescript-fetch/tests/default/test/PetApiFactory.ts
samples/client/petstore/typescript-fetch/tests/default/test/StoreApiFactory.ts
samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/PetApi.java
samples/server/petstore/jaxrs-resteasy/default/src/gen/java/io/swagger/api/PetApiService.java
samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/io/swagger/model/User.java
samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApi.java
samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApiController.java
samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeApi.java
samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeApiController.java
2017-01-05 17:44:39 +08:00
wing328
8ccf9828e4
[Python] add hasConsumes/hasProduces to Python API template ( #4419 )
...
* add hasConsumes/hasProduces to python api template
* remove unused code in python
* fix isFile in the api doc (python)
2016-12-18 17:20:10 +08:00
Vlad Frolov
4d2a13018b
[Python] Make the code look Pythonic ( #4352 )
2016-12-09 17:26:23 +08:00
wing328
58b66a0b0a
python code style enhancement ( #4238 )
2016-11-22 23:01:41 +08:00
wing328
5de338d781
[Python] fix tags
with underscore for python ( #3995 )
...
* fix tag with underscore for python
* remove log
2016-10-14 17:49:43 +08:00
wing328
d0f3cd642d
fix missing () in python doc
2016-10-13 15:28:11 +08:00
wing328
ebfddd0a58
remove unnecessary changes for python codegen
2016-08-31 15:49:22 +08:00
Ville Skyttä
fa0e0f4fcc
python: Update petstore
2016-08-30 08:07:35 +03:00
Ville Skyttä
224fd208e7
Various python cleanups ( #3650 )
...
* python: Let logging format messages on demand
* python: Use six more
* python: Remove unused imports
* python: flake8 fixes
* python: Make examples compatible with Python 3
* python: Spelling fixes
2016-08-30 10:16:17 +08:00
wing328
a58845bb0f
add function to handle missing delimiter in regex
2016-08-22 18:01:06 +08:00
Scott Williams
68d63ec783
Create setter for models inline with Issue 3210
2016-08-15 23:31:30 +01:00
wing328
9489f7d3eb
clear import mapping for gnereators that do not use it
2016-07-26 14:40:29 +08:00
wing328
89befeb45b
fix long issue in python3
2016-07-07 22:17:27 +08:00