* Add overloaded method to take an InputStream for the request body, and fix a bug with collections
* Use fully qualified name for InputStream to avoid potential conflicts
* Add support for Input Stream choosing content type, and fix a bug
* Ensure GET requests send an empty request body!
* Improve: update sample tests automatically
* security test
* Update sample
- bin/php-petstore.sh
- bin/security/php-petstore.sh
The security test has not been updated for a while.
* Small fixes to prevent crash when empty json body is provided.
* WIP: plug mem-leaks
* fixup: add the QJsonObject instance in toJsonArray instead of pointer
* fixup: simplify toJsonMap
Actually the original solution is incomplete, because "innerType" maps to a single C++ type. Have a look at Qt's builtin QJsonObject::fromVariantMap.
* Updates to antis81:patch-1 after tests.
* update to remove string allocation
* Updates due to address of members being passed
* Update PetStore Examples
* Small updates for Header includes
* Add path & file separator (/) to return the correct path
Add the separator between the tempFolderPath and the sanitized filename so that the path to the file is correct.
(Fixes#7670)
* Remove separator from generated file
* Add separator
Add the separator between the tempFolderPath and the sanitized filename so that the path to the file is correct.
(Fixes#7670)
* Update sample code
Via ./bin/php-petstore.sh
* Added genericModelSubstitutes if using Optional
As per https://github.com/springfox/springfox/issues/1848 Doesn't seem to fix the problem, but is what springfox recommends so might be aprt of it.
* Added config package to scans
If you have defined apiPackage and basepackage (e.g. as com.example.api) but not defined configPackage then config is still in io.swagger.config and is not included in the component scan. This means the config is not used when generating the swagger definition from the code. Fixed by including configPackage also in the scan.
* Ran spring-all-pestore.sh update script
* Converted tabs to spaces
* Ran spring-all-pestore.sh update script
* [Java][retrofit2] Fix for issue #7446: file upload sets filename as baseName instead of a dynamic filename. The solution is to use okhttp3.MultipartBody.Part instead of RequestBody in formParams template.
* Changes corresponding to review comments
* Petstore Samples
* Fixed tests
* Regenerate PetApiTest, OrderTest
The same test code as deleted is in the 'tests' directory.
* Move test code 'test' -> 'tests', and Regenerate test/Model/PetTest.php
* Regenerate 'test' directory
rm -rf samples/client/petstore/php/SwaggerClient-php/test && bin/php-petstore.sh
* Replacing calls to dataTaskWithRequest:completionHandler:
In objc ApiClient-body.mustache, replacing calls to AFNetworking's deprecated `dataTaskWithRequest:completionHandler:` with calls to `dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler:`.
* Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change: ./bin/objc-petstore.sh and ./bin/security/objc-petstore.sh
* fix issue-7453; make jersey 2 generated code thread safe by following the withHttpInfo pattern used by many other generated clients
* fix issue-7453; make jersey 2 generated code thread safe by following the withHttpInfo pattern used by many other generated clients
* Added support for application/xml content-type for GO language
Issue #7463
* Added test scripts for Go lang "withXml" feature
* Added samples for Go land "withXml" feature.
* "withXml" feature for Go language is only available for client.
* [csharp] ctor params should always be camelCase
After PR #6305, var names defaulted to PascalCase results in constructor
arguments also being PacalCase. Model properties and constructor
arguments have no reason to be the same case, and in fact may cause
issues (`name = name` will result in a compilation error).
This commit forces all constructor params in models to lowerCase.
This is a necessary change, for instance, if client SDK consumers assign
using named args:
var a = new Model(first = "", second = "")
The PacalCase default and update to constructor arg casing will break
existing consumers of the client.
See #7070 for more details and discussion.
* [csharp] Regenerate samples
* [csharp] Remove client models generated from a different spec.
* [csharp] Escape reserved words on camelcase/lowercase lambdas
* [csharp] Regenerate samples
* Fix the GNAT project for the client and server to avoid using unecessary projects on
the client side
* Define a minimal configuration for user and application definition
* Fix the server skeleton to emit the response only when the status code is 200
* Fix the Ada petstore GNAT project
* fixing "decoding Unicode is not supported" error for py2 when data is unicode
* allowing nonstandard methods for tornado python client.
* Making sure to return unicode when needed
Using the option `taggedUnions` will create a union type for each parent
type instead of extending interfaces. The union types are tagged by using
the discriminator values.
And also:
* Add support for aliases;
* Add support for read-only properties.
* Rest-assured http client has been added
ApiClient has been added
@Deprecated has been added for operation
{{{returnType}}} has been fixed
build.gradle.mustache, build.sbt.mustache, api_doc_mustache has been added
Samples has been added for rest-assured
Useless supporting files has been removed for rest-assured
Sample has been added for rest-assured
* Tests has been added
* Doc and tests has been fixed, JSON.mustache moved to common
* Issue 7440 Added support for returning response in jaxrs-spec interfaces.
* Issue-7386 Updates samples for jaxrs-spec interfaces introduced in issue 7386.
- add new config options:
cabalPackage
Set the cabal package name, which consists of one or more alphanumeric words separated by hyphens
cabalVersion
Set the cabal version number, consisting of a sequence of one or more integers separated by dots
baseModule
Set the base module namespace
requestType
Set the name of the type used to generate requests
configType
Set the name of the type used for configuration
* Fix calling the 'Call' procedure to submit the request for the Ada client when a request
has form parameters
* Rebuild the files by running bin/ada-petstore.sh
* Ada generator generates "=>" (correct syntax) instead of "->". Fixes#7450
* Updated the Ada petstore samples
* Committing "VERSION" file and the rest of the petstore samples
* Redone the algorithm to sort the models by their dependencies, to create correct *-model.ads files.
To fix#7485
* changed tabs into spaces
* [tools] Make sed in new.sh more cross-platform
The -r option passed to sed is a GNU sed option for extended regex
evaluation. The -E option evaluates the same option, and is part of the
POSIX standard, meaning this option is available in GNU sed as well as
Apple's BSD variant.
This commit removes the need for users to install gnu-sed on Mac.
* [ktor] Initial ktor (kotlin-server)
This adds a very barebones implementation for a ktor server generator.
This supports metrics and typed locations. All endpoins are stubbed to
return HTTP/1.1 501 Not Implemented.
* [ktor] Initial sample
* [ktor] Adding options for select feature installs
Options available:
* featureAutoHead
* featureConditionalHeaders
* featureHSTS
* featureCORS
* featureCompression
* [ktor] Start of auth functionality
* [ktor] API key auth placeholder
* Add basic support for oauth2 configurations
ktor doesn't seem to explicitly accept oauth flow properties in its
configuration object. This may be a blocker for 'implicit' flow
definitions.
* Added example response objects
* [ktor] Route for apis with bodies, some cleanup
ktor locations are only supported for routes with path/query parameters.
Routes with body or file parameters must be declared with traditional
route api.
This commit also includes lambdas for simplifying processing in
library-based server generator code. As an example, ktor requires
lowercase http methods while spring (a potential future generator)
would require an uppercase such as HttpMethod.GET. It doesn't make sense
to modify these in the operations post-process method because that
format wouldn't be universally desirable.
The lambdas included in the KotlinServerCodegen:
* lowercase: converts all text to lowercase
* uppercase: converts all text to UPPERCASE
* titlecase: converts words (with configurable delim) to Title Case
* indented|indented_8|indented_12|indented_16: these helpers apply the
same desired indent to all lines of an included fragment's text.
* Fix some javadoc issues in lambda classes
* Update kotlin-server-petstore.bat
Change `kotlin` to `kotlin-server`
* Fix javadoc error messages in CI
* add luarocks spec
* remove trailing spaces
* remove rockspec filename option
* update lua rockspec
* update rockspec based on feedback
* remove configuration which is not needed
* remove api_client, which is no longer needed
* Build sample prior to code changes so differences are easier to decipher
* Add byte array type adapter for okhttp-gson (java8 only)
* Unit revealed that Gson (or GsonFire) defaults to escape = (equal sign) out of base64 string. Add disableHtmlEscaping() to gsonbuilder.
* Update specs and samples to include format=byte and include junit test of byte array serialization and deserialization.
* Implement recommendations by @cbornet including: Use okio.ByteString for base64 conversions instead of java 8 lib since the okhttp-gson client already includes okio. Remove setting to disableHtmlEscaping. Rename LocalByteArrayAdapter to ByteArrayAdapter.
* Update spec and sample for java okhttp-gson library client
* Undo addition of profilePhoto property. A format byte property is already available under the format_test definition.
* Put previously deleted tests back. Modified testFindPetsByTags() to verify exception since the server now returns a 500 for this request.
* Update test to pass when run against docker containerized server swaggerapi/petstore (heads up, this test fails if calling out to the internet published version of http://petstore.swagger.io)
* Split up model template into partials
* Change models from class to struct.
This fixes issue https://github.com/swagger-api/swagger-codegen/issues/6941.
In this change, we make our Swift4 generated model objects struct instead of class. However, in order to do this, we needed to handle the following edge cases:
* Inheritance and polymorphism (allOf)
* With classes, we use inheritance. So therefore, the parent properties are ONLY on the parent generated class, and the model object which derives from the parent class picks up those properties through inheritance.
* However, structs do not support inheritance. So we simply duplicate the parent allOf properties in the child struct.
* We have to handle the case where the property name on the struct may be different than the property name in the JSON. By default, the Codable protocol assumes that the JSON property name is the same as the struct property name. If they need to be different, then we generate a CodingKeys string enum, which contains the mapping between struct property name and JSON property name.
* additionalProperties. We cannot use the default Codable implementation for the additionalProperties, since it will look for an actual dictionary called "additionalProperties" in the JSON. Therefore, for model objects which have additionalProperties, we must generate our own implementation for the Decodable and Encodable protocols.
I have run ./bin/swift4-all.sh and ./bin/swift4-test.sh to re-generate all of the sources, and I have verified that the generated code in samples/clients/test/swift4/default builds and the unit tests pass.
* Update VERSION in .swagger-codegen
* Update generated code for swift4-test schema
* #7365: use enums string / number literals for request parameter if it is an enum
* #7365: use enums string / number literals for request parameter if it is an enum
* #7365: use enums string / number literals for request parameter if it is an enum
* #7365: improve docs
* #7365: move code to AbstractTypeScriptClientCodegen, remove redundant code in TypeScriptAngularClientCodegen, change type Object to Number in numericEnumValuesToEnumTypeUnion()
* #7365: move code to AbstractTypeScriptClientCodegen, remove redundant code in TypeScriptAngularClientCodegen, change type Object to Number in numericEnumValuesToEnumTypeUnion()
* #7365: allow parameter data type customizations
* #7365: re-enable disabled unit test assertions
* #7365: remove enum handling from type declaration generation
* #7365: generate all typescript samples
* #7365: re-enable disabled unit test assertion
* copy mustache templates from dart generator
* Start with generator by copying the DartClientCodegen for now
* at least we know this is not for a browser..
* First working version for a simple swagger configuration
* remove browserClient parameter, since it doesn't make sense for flutter
* Take care of complex types to support object hierarchies
* add null safety
* add small test for options
* add flutter-petstore scripts
* generate flutter petstore output
* Add new flutter test project
* move generated client to make it usable
* use generated swagger petstore plugin
* add support for lists of objects
* add DateTime support
* fix listFromJson implementation
* fix NPEs in DateTime operations + place order in sample
* Small readme changes
* bugfixes
* Use flutter-compatible implementation as default dart implementation
* fix generated samples
* Make lists serializable, now all dart test cases are working again
* better list implementation
* use StringBuffer
* removed FlutterClientCodegen
* fix browser client
* fix dependencies
* swagger-browser-client for browserClient testcases
* fix scripts
* removed flutter scripts
* add map support and simplify code via using .toJson contract
* remove unneeded devDependencies
* Regenerated samples
* fix call to mapFromJson, it is not a constructor
* remove pointless string serialization
* regenerated dart samples
* update for ze-ph generator stub to support Zend Expressive 2.1 and Path Handler 0.3
* ze-ph: for each operation generator creates special DTO model from its query parameters
* ze-ph: generation of extra TODO's for complex container type and update for samples
* Ada generator generates "=>" (correct syntax) instead of "->". Fixes#7450
* Updated the Ada petstore samples
* Committing "VERSION" file and the rest of the petstore samples
* [csharp] Support composition on toJson
Previous implementation assumed specification only supports polymorphic
associations (via discrimator), although the code didn't seem to be
setup correctly for that in the first place. That is, the parent object
must define the discriminator (see
https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#models-with-polymorphism-support),
so NOT HAS parent AND HAS discriminator doesn't make sense.
From a C# perspective, base classes should have the method marked
virtual and derived classes should override the method. This supports
both composition and polymorphic definitions.
* [csharp] this.Configuration in api template
Unprefixed Configuration property access leads to ambiguous references
when spec defines a Configuration model.
* [csharp] Models/properties support nested arrays
Previous implementation didn't support multiple levels of array with
array items as OpenAPI spec supports. This means an object defined as
type: array with items = type: array|items=double (which is common in
GIS) would not be possible.
This implementation assumes generics in the nested type definitions, so
the above would generate List<List<double?>> for model parent types as
well as property type declarations.
* [csharp] Regenerate integration test sample
* [csharp] Set "Client" case sensitive as reserved
* [csharp] Regenerate security sample
* [csharp] Regenerate samples
* [csharp] Support composition on toJson
Previous implementation assumed specification only supports polymorphic
associations (via discrimator), although the code didn't seem to be
setup correctly for that in the first place. That is, the parent object
must define the discriminator (see
https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#models-with-polymorphism-support),
so NOT HAS parent AND HAS discriminator doesn't make sense.
From a C# perspective, base classes should have the method marked
virtual and derived classes should override the method. This supports
both composition and polymorphic definitions.
* [csharp] Regenerate integration test files
* [csharp] Regenerate samples
* [csharp] Regenerate security sample
* [csharp] this.Configuration in api template
Unprefixed Configuration property access leads to ambiguous references
when spec defines a Configuration model.
* [csharp] Regenerate samples
* Fix the comparison between two model types to compare them recursively
and make sure we sort the model types according to their dependencies
* Run bin/ada-petstore.sh to update the generated Ada client samples
* Fix Ada client generated code to avoid having a spurious body name for parameters passed in the body
* Run bin/ada-petstore.sh to update the generated Ada client samples
* [erlang-client] fix body param from being included path and base path to remove host
* [erlang-client] move request logic out of api functions to utils module
* [erlang-client] add support for passing http client configuration to requests
* [erlang-client] update auth handling
* [erlang-client] remove underscore2, replacing with original underscore + replaceAll
* Add default value and required parameter support to vertx server templates. Fix for #7409.
* Added missing serviceId declaration to workaround #allParams section clearing the vendorExtensions map
* [Rust] Consider error statuscodes to be errors
* [Rust] Introduce 'ApiError' type for 4xx/5xx resp
This updates the previous commit which added an 'ErrorStatus' variant to
an 'ApiError' variant.
It does not specialize the error to the specific possible error
responses yet, rather returning a 'serde_json::Value' for any case.
This will lose any error messages which cannot be parsed as json and
instead return a json-parse error.
A future change should update the generated signatures such that the
returned future's error type is specialized to the specific errors that
may be returned by that api (and possibly a catchall json::Value still).
* [Rust] Regenerate petstore samples
* [Rust] Add error example to petstore sample
* [Java] #3024 - Add build-helper-maven-plugin version to retrofit client template
* [Java] #3024 - Add build-helper-maven-plugin version to feign client template
* [Java] #3024 - Add build-helper-maven-plugin version to jersey client template
* [Java] #3024 - Add build-helper-maven-plugin version to resteasy client template
* Updated the version of Scalatra to the latest (2.6.2)
- Updated Scalatra 2.6.2 (latest)
- Updated Scala 2.12.4
- Updated sbt 1.1.0
- Reduced dependent artifacts to a minimum
- Cleaned up build.sbt
- Changed the package name from client to server
- Set log output (logback)
- Updated web.xml for servlet 3.1
* rename package 'com.wordnik' -> 'io.swagger'
* Added rolling file appender to logback.xml
* Disable creation of empty json fields and fields for primitives which were not set, but using default values
modelnamePrefix will be the one passed from command line or SWG if none
* Updates after review
Also common http files are splitted
Update Petstore examples
* Small Fixes for cleaning up arrays of arrays/maps
* Changes
- Api Body pass by Reference, avoid seg fault due to deletion of auto constructed object passed as parameter.
- Support Maps and Arrays upto a depth of 2
- Refactor Helpers to handle Maps and simplify code
* Remove size check due to possible incorrect type
* Update PetStore Examples for Qt5 C++ and small fixes for QDate/QDateTime
* Updates after review. Fixes typo and remove usage of auto keyword.
* Restored usage of auto keyword.
* Regenerate test/UserApiTest.php
The same implementation as testLoginUser() is in tests/UserApiTest.php
* Delete test/Client/ObjectSerializerTest.php
The same implementation is in tests/ObjectSerializerTest.php
* Update Petstore sample
- bin/php-petstore.sh
- bin/security/php-petstore.sh
* #7359 Fix - use reflection to instantiate non-generated class (#7360)
* add tests for java vertx petstore
* add swagger example to README.md (#7368)
* Fix assignment of new object instance to variable
Fixes `Error in foobar$fromJSONString(s) : object 'CategoryObject' not found`
Discussion in https://github.com/swagger-api/swagger-codegen/issues/6520#issuecomment-357132746 ,
thanks @wing328 for encouraging.
* [scala] Escape reserved words, support Array[Byte]
Previously, Array[Byte] was compiling to ArrayByte. This provides a type
mapping to output the correct type.
This also escapes reserved words with grave accents, as is most common
in Scala. Escaping with an underscore prefix breaks serialization (in
Jackson, for example) unless templates are modified manually. Escaping
using grave accent should unblock most serializers from requiring
template modifications.
* [scala] Regenerate integration test outputs
* [scala] Regenerate samples
* [scala] Remove unused imports in related codegen files
* [scala] Fix default values in scala client
This uses consistent logic for optional types with default values in the
scala client. Also, uses Option(default) instead of Some(default) to
guard against people defining defaultValue = null. Option(null) becomes
None while Some(null) defines a null value explicitly and will break
maplike operations.
* [scala] Regenerate client sample
* [scala] Add missing json4s import, which will be added by another PR but allows current samples to generate
* [scala] Include integration tests for required attributes support
* [scala] Support string types with formats
This adds support for better support of type=string and
format={date,date-time,binary,byte}. Previously, binary and byte were
inconsistently defined as strings rather than byte arrays, while
date/date-time were parsing default values into formats that did not
match OpenAPI/Swagger 2.0 specifications for full-date and date-time.
We may want to consider pulling in json4s-ext to support wider date
formats and moving to date=LocalDate and date-time=ZonedDateTime.
This will have breaking changes for consumers expecting binary/byte to
be strings rather than byte arrays.
* [scala] Unique parameter names in integration test, to avoid seemingly conflicting names
* [scala] Regenerate client sample
* Sort file listings in AssertFile.java
Per File#list() javadocs:
There is no guarantee that the name strings in the resulting array
will appear in any specific order; they are not, in particular,
guaranteed to appear in alphabetical order.
I'm unable to repro directory listing failures on OS X High Sierra or
Ubuntu 16.04 under Parallels, so it's not clear to me if listing order
is indeterminate per-platform or the behavior is just not defined and
up to the platform's installed runtime. Sorting the array of strings
prior to comparison should resolve this issue on every platform/runtime.
* [scala] exclude api tests for integration test gen script
Script should match options in the integration test class
* [scala] Temporarily disable client integration tests
CI doesn't seem to pick up template changes in integration tests.
Disabling scala client integration tests, pending investigation of the
issue.
* [scala] Remove redundant json4s import
* [scala] Regenerate integration test
* [scala] Regenerate sample
* Initialize router in init method and re-use router member to create SwaggerRouter
* Added generated samples for 7320 fix
* Fixed alignment to 4 spaces for 7320 fix
* Add Ada client petstore samples
- Add script to generate Ada client support with swagger-codegen
- Add files to build the Ada sample
- Add main program to use the generated client samples API
and connect to the server to perform some operations
* Add some description for the samples
* Update the documentation to explain how to build, how to use the generated Ada client code
* Add server support for path parameters
- Update postProcessOperations to scan each path parameter and emit a x-path-index
vendor attribute to tell the index of the path parameter
* Add and fix Ada server code package declaration
- fix declaration of operations
- generate a generic package that must be instantiated with the target server implementation
and which provides the skeleton (deserialization and serialization of data)
* Implement the Ada server side operations
- extract body, query parameters, path parameters
- serialize the result
- register operations to the server according to the path/routes
* Update the code generation to generate server Ada implementation code
* Improvement of Ada server support: generate the swagger.json template file
* Define toModelName operation to the creation of a model identifier
* Add support for server permission generation
- collect the security scopes in postProcessAuthMethod() method and make sure
these scopes have unique identifiers. Some scopes correspond to URLs
but others correspond to pseudo identifiers.
* Use the #lambdaAdaComment filter to indent correctly a multi-line description
* Fix model generation to support arrays
* Update the generated GNAT project file
* Refactoring and improvement of server code generation
- Change the server generated code to pass a Context_Type object
to allow the server implementation to get/set headers in the request/response
and control what is put in some responses
- Generate the security permissions based on the scopes that have been collected
* Server code generation improvement
- Fix generation of GNAT project
- Generate the intermediate Ada packages if necessary
- Generate the server main
* Ada server main template
* Ada server code improvement
- Add support to generate server permission verification
- Fix the GNAT project definition
- Templates for Ada intermediate packages
* Skeleton for the server side implementation
* Generate an empty Ada server implementation
* Templates for the Ada server implementation
* Add a README.md file and a GNAT config.gpr file
* New templates to document the generated Ada server
* Add server configuration file for the Ada server
* Fix the log message in the Ada server to report the correct URI to connect to
* Generate the Ada server configuration file
* Improvement of Ada code model to support nullable types
* Update the Ada server templates
* Refactor the Ada code generator
- separate the Ada client and Ada server code generators
- register the Ada server code generator under the name 'ada-server'
keep 'ada' for the client Ada code generator
- moved the common Ada code operation supports to the AbstractAdaCodegen
* Improvement and cleanup of Ada client and server code
- new template for the client main program
- fix the GNAT project template for client or server programs
- remove unused options to better use the --model-package option
* Fix the GNAT project file name to use a lower case name
Fix the default GNAT config
Fix the headers of intermediate Ada package files
* Regenerate the model and client Ada files
* Update the Ada client sample to take into account the Nullable types
* Regenerate some files with Ada Swagger Codegen
* Ignore generation of petstore.gpr
* Disable creation of empty json fields and fields for primitives which were not set, but using default values
modelnamePrefix will be the one passed from command line or SWG if none
* Updates after review
Also common http files are splitted
Update Petstore examples
* Initial commit, Generates everything necessary to run a performnace test against a swagger api. Just have to fill out the CSV feeder files with your data.
* adding samples and gatling-petstore.sh file
* Extending the AbstractScalaCodeGen
* Checking in the CodegenConfig file as it is needed to generate
* removing escaped reserved words
* Changed model to be able to make all variables utilize an underscore while json fields are still just the variable name
* Changing underscore to var as interpolation can not start with a _ in scala
* Fixing path params
* allow you to pass in a system property to define which config to use as a workload profile, use rate and instance multipliers to scale up and down your test, added ramp down after the test is completed, added global assertions.
* Addressing PR feedback
* missed semi-colon
* Bringing everything up to date with the renames that were suggested
* [haskell-http-client] handle */* mimetype correctly
* [haskell-http-client] generate separate api modules, for each child api
* [haskell-http-client] add cliOption "allowNonUniqueOperationIds"
When cli option "allowNonUniqueOperationIds" is true,
allows *different* API modules to contain the same operationId,
and then each API must be imported qualified.
* Fix some go client formatting issues
* Fix go client go imports
* Run `goimports -w .` on examples directory
* Sort imports in api
* Add new line between each property
Before secret feature was used to add new line using two property
declaration in the same line. There should be no new line before
first property. The easiest way is to use `-first` special
property
https://github.com/samskivert/jmustache#-first-and--last
New line are required so `goimports` won't reformat whitespaces between
property name and type.
* Change whitespaces to tabs
* Fix whitespaces in api_client
There is a new line between each service to prevent `goimports` from
adding whitespaces between types and names
* Fix more whitespaces
There was a need to set special delimeter for formatting in the commit.
Go slices use curly braces and `jmustache` got confused when found
triple curly braces.
* Fix whitespaces in configuration.mustache
* Fix whitespaces for api response
* Support for optional description
Do not add whitespace if description is missing
* Add new lines between enum values to prevent formatting
* Generate go code from current code
- imports are not sorted :(
- there are extra whitespaces for different languages. I don't know why
* Run generate for security tests
* Move test codes in "test" to "tests".
* Simplify class name specification
* Regenerate test/Api/StoreApiTest.php
testGetInventory already exists in tests/StoreApiTest.php
This is the initial Codegen for Elm 0.18.
Please try it out and provide feedback.
Not yet supported:
* path variables;
* additionalProperties;
* authentication;
* recursive types.
* Commit leftover snapshot changes
* Add logic to deal with non-JSON body params
If the spec specifies a list of consumes MIME types, default to the
first MIME type in the list instead of "application/json" (the user may
still override this by passing "Content-Type" in options.headers).
Additionally, only perform explicit JSON serialization if the data type
of the body parameter is not "string", or if it is string, only when the
content type is "application/json".
* Update snapshots
* Added pkmst-microservice toolkit
* formatted
* replaces tab with blank spaces
* adding documentation folder
* adding documentation folder
* Update readme.mustache
Added feature set offered by pkmst
* updated readme
* Update io.swagger.codegen.CodegenConfig
Arranged pkmstServerCodeGen and SymfonyServerCodegen in aphabatical order
* Update readme.mustache
* renamed according to convention and added typeinfoannotation
* removed tabs
* updated codegen which extends abstractjavacodegen
* Added the script files and rectified the errors
* folder name changed and commons -lang3 version upgraded
* updated readme.mustache
* updated logging filter
* Added petstore to samples and updated the pom for the same
* Added java-pkmst sample to pom.xml.circleci
* updated readme.mustache
* use status codes in the variants of the responses instead of message
* samples
* add missing {{code}}
* use human friendly idents if possible
* generate samples
* salvage an oversight
* Prevent usage of reserved keyword for model fields
* Changes from code review to follow JS convention of using toParamName and toVarName
* Another small change from code review. Removing from postProcess because it is already called from somewhere else.
* Ran bin/aspnetcore-petstore-server.sh
* Added contact information to startup.cs
* updated to support NAME as well
* updated samples
* updated NAME default
* Updated Codegenerator as well as added new swagger-original mustache template
* updated Startup.cs template to provide guidance for original Swagger file
* Updated Sample
* Added support for VERSION and APPNAME from Swagger file into Startup.cs for Swashbuckle SwaggerGen
* Ran bin/aspnetcore-petstore-server.sh
* Added contact information
* Added contact information to startup.cs
* Move the test code to the appropriate test case
* currently, InvalidArgumentException will be thrown
* Remove unnecessary tests at this time
* Unify into single quotes
* MMORCH-428: Export the Authorization struct
This is needed so that code can check that the version of Authorization
in the auto-generated code is the same as the version it is using. If
the versions are not exactly the same then the lookup into the TypeMap
will not work.
* Add Rust as a supported language for client and server.
Clarify that there are two Rust client implementations, and one Rust server implementation.
* Percent-encode path and query parameters in client URLs
Fixes#122
Also don't include a question mark at the end of the path when there are no query paramters.
Fixes#121
* Rust2 client: add --host and --port parameters to example client.
Allows the example command-line client to override the default host and port.
* Extract default host and port from Swagger file.
* Derive 'Eq' and 'Ord' on enums
* Rust2: improve server code structure.
server.rs (main.rs) - main entry point for binary; starts the web server and points it at the server code within the library.
server_lib/mod.rs (lib.rs) - root of library; creates the server.
server_lib/server.rs (server.rs) - actual server code
The old server_lib/mod.rs is now server_lib/server.rs; server_lib/mod.rs is new.
This structure is easy to map onto a server implementation; unfortunately we can't get it exactly right here because of the limitations of cargo's examples/ folder.
* Rust2: Explain fully how to use the example code in your project.
* Added plaintext support
* Linting
* MGJ Markups
* Move errant file to 'rust-server'
Rust2 was the old name
* Add license and description to Cargo.toml
For rust-server, getting them from the swagger
* Valid Java doesn't have uninitialised variables...
* Default license to "Unlicense"
* Set license to "Unlicense" for generated crates
* Updated to .NET Core 2.0
* Fixed issue with IConfiguration vs. IConfigurationRoot
* Ran bin/aspnetcore-petstore-server.sh
* Updated to .NET Core 2.0
* Fixed issue with IConfiguration vs. IConfigurationRoot
* Ran bin/aspnetcore-petstore-server.sh
* Add README.md to the typescript jquery client generator
* Fix from code reviews about the addition of README.md. Made the fix in fetch too since it was a copy paste
* Operation now returns StatusCode Stubs as well
* Updated mustache file to use comments
return StatusCode(..) is now commented out.
* Change default(..) to not escape the type
default(dataType) --> default(&dataType)
* Return IActionResult no matter what..
* Updated formatting
* Ran bin/aspnetcore-petstore-server.sh
* Do not apply content-type header if no request body
* Set content-type header if there are form params
* Add tests
* Run update script
* Regenerated sample clients
* add support for async routes/endpoints
you can now set --optional-properties async=true to generate
a nancyfx server stub that uses asynchronous programming.
(cherry picked from commit 126869cb0b967e8063417e11993cf6326ce8ffd4)
* add nancyfx-petstore-server-async.sh to generate sample of async nancyfx.
* Rename async => asyncServer
* update bin/nancyfx-petstore-server-async.sh
* rename async => asyncServer in api.mustache + small bugfix
* run ./bin/nancyfx-petstore-server.sh and ./bin/nancyfx-petstore-server-async.sh
* remove additional new line in api.mustache + add space after if
* run ./bin/nancyfx-petstore-server.sh and ./bin/nancyfx-petstore-server-async.sh
* Map `date` fields to LocalDate c# type + add a JsonConverter for LocalDate.
* #6818: support for security definitions and some refactoring
* adding support for Either
* adding dates with TimeZone (date-time) and Local (date)
* cleanup
* generating code
* Updated swagger-ui wget url to https
* Issue #6902 Add Observe/ReportProgress pass through variables to the response for each api call for angular 4.3 and above
* Issue #6902 Fixed problem where extra comma as generated and should
not have been.
* Issue #6902 Fixed compiltion issue for Angular 4.3
* Objects are represented by `ModelBase.h`, not `Object.h` which does not exist.
* Use correct relative imports for files in the `model` and `api` folders.
* [CppRest] Update cpprest petstore client sample.
* Implement `Object` class to support arbitrary types.
* [CppRest] Update cpprest petstore client sample.
* [CppRest] Add newly generated files to petstore client sample.
* [CppRest] Add `Object` to CMakeLists.
* Initial Commit
* Removed unneeded class, Updated names as per naming conventions, Removed licensing info from generated code
* Moved samples from client folder to server
* Fixed naming issue with scripts in the bin
* improved code format for api
* fixed compile issue and improved formatting
* fixed compile issue and improved formatting
* update versions of dependencies on swift4 and swift3
* change syntax for swift4
* run petstore script
* change enum case from UpperCamel to lowerCamel
* remove unneeded break statements
* avoid wrapping conditionals in parentheses
* avoid force casting
* run pod update on petstore/swift4/rxswift
* update project for swift 4
* run swift4-petstore-all.sh
* fix compile error
* avoid use iso8601 date strategy for encoder / decoder
* resolve file references
* the result I want to obtain
* add csharp-petstore-net-40.bat for windows
* just ran bin\windows\csharp-petstore-all.bat
* Removed those directories:
- samples\client\petstore\csharp
- samples\client\petstore\csharp-dotnet2
then ran :
bin\windows\csharp-petstore-all.bat
* - update JsonSubTypes to 1.1.3 by using nuget dependency (the package is compatible with net40)
- allign all version of Newtonsoft.Json to 10.0.3
* the result of bin\windows\csharp-petstore-all.bat
* ran bin\security\windows\csharp-petstore.bat
* fix: non-zero exit code if tests fail
* tests: use local petserver to run tests
* fix: non-zero exit code if tests fail
* tests: use local petserver to run tests
* fix: creating ssl context in old version of Python
* chore: remove unused target from Makefile
* doc: changes from upstream
* fix: tornado client raises NotImplementedError in older version of Python
* [csharp] Convert "false" properties to booleans
It appears as though "false" strings in additionalProperties are no
longer treated as false booleans. This may be an issue elsewhere, but a
simple fix is to always explicitly set the boolean value in a generator
class back to the additionalProperties map to convert boolean Strings to
boolean Objects.
* [nancyfx] Clean up async default option handling
* [nancyfx] Include asyncServer=false in sample script
* [csharp] Regenerate samples
* [csharp] Resolve .net 4 generation issues
Some functionality is missing from .NET 4.0, such as IReadonlyDictionary
and Type.GetTypeInfo().
This commit resolves compilation of generated .NET 4.0 code, requiring
no conditional versioning of Newtonsoft.Json.
* [csharp] Regenerate .net 4.0 sample
* [csharp] Resolve .NET 4.0 sample compile
Sample build.sh wasn't accounting for targeting different FCL correctly.
That is, when passing "net40" to the -sdk option, it would use the
default -sdk:4 and -langversion:6. These don't necessarily match with
what is installed on a machine with only .NET 4.0 (which is our targeted
use case here).
To resolve, we need to define another version-specific value for passing
to the mcs -sdk option (see man mcs for details).
This option currently isn't overridable in the client codegen class.
Also, langversion is set specifically to the version of C# available to
the targeted SDK version. If there is need, we may extend this to
something like:
langversion=${MCS_LANG_VERSION:-6}
To allow users to run as:
env MCS_LANG_VERSION=5 sh build.sh
I haven't done this because I doubt there's much of a use case via this
script. I'm assuming most consumers will build via IDE or MSBuild.
* [csharp] Revert bin/csharp-petstore.sh to 3.5
* [csharp] Regenerate .NET 3.5 sample
* [csharp] Resolve nuget issue with existing files
* [csharp] Update -all.sh, regenerate samples
* WIP: initial commit for Erlang client generator
* add models types and function type specs
* fix type specs when models are the type and support QS lists
* make method lowercase in postprocessoperations
* add model encode function
* add erlang client sample
* add windows client sample script
* proper return type spec and handle return error messages
* The get method template is modified to return the value of the enum instead of the enum itself.
* Update of the Petstore CXF server sample
* Update of the Petstore CXF client sample
* Update of the Petstore CXF server annotated base path sample
* Update of the Petstore CXF server non spring application sample
* adding "Read Timeout" getters and setters for the Jersey and OkHttp
based ApiClients
adding "Write Timeout" getters and setters for the OkHttp based
ApiClient
adding tests for the OkHttpClient covering the new getters and setters
* generated files from the bin scripts
* [CppRest] Replace U macro with conversion function for default string values.
* [CppRest] Replace U macro with conversion function in templates.
* [CppRest] Update cpprest petstore client sample.
* Replaced isomorphic fetch with portable fetch
* Ran scripts in bin
* reference custom.d.ts in api.ts
* ran scripts and added custom.d.ts files to git
* Ran scripts in bin after merge
* regenerated security tests
* Implemented fix for #6006. Mime-type support for accepts and
content-type.
* Review comments of @macjohnny incorporated
* merge with latest and retest
* merge with latest and retest. Now correctly generated with new Maven build
`unicode` does not exist in py3, therefore since six is already imported
switch to using `six.u` so that `unicode` is used on py2 and `str` is used
on py3.
* Add support for the google-api-client
* When there's no return type, just return (no parsing the response)
* Update the deserialization to use a Jackson typeref.
* Delete the auth mustache files as we don't need them
* Stop generating unneeded auth files; get SBT/gradle working with the generated module
* Add builder-style methods to the google-api-client ApiClient for getting API instances
* Update the README to reflect the new client library option
* Generated overloaded methods to send query params as a Map<String, Object>
* Add files for Sample codes
* Add type in angle brackets to support Java 6
* Required query params must be added to the Map of params. Update sample code.
* Use explicit types instead of diamonds to support Java6 in one more place.
* Clean up javadoc warnings in generated code / remove pointless return statements
* Clean up extra newlines in generated code
The linting results for the generated samples are as follows
where the first number is the BEFORE and the second is AFTER.
pyclient 7714 vs. 120
pyclient3 7717 vs. 120
pyclient3-asyncio 7584 vs. 120
pyclient-tornado 7633 vs. 120
pyclient3-tornado 7633 vs. 120
For the complete details please see the following gist.
https://gist.github.com/kenjones-cisco/2eb69a7e8db75e9fd53789f01570d9f2
Enforces linting for python clients by running flake8 for the generated
python client.
* add support for async routes/endpoints
you can now set --optional-properties async=true to generate
a nancyfx server stub that uses asynchronous programming.
(cherry picked from commit 126869cb0b967e8063417e11993cf6326ce8ffd4)
* add nancyfx-petstore-server-async.sh to generate sample of async nancyfx.
* Rename async => asyncServer
* update bin/nancyfx-petstore-server-async.sh
* rename async => asyncServer in api.mustache + small bugfix
* run ./bin/nancyfx-petstore-server.sh and ./bin/nancyfx-petstore-server-async.sh
* remove additional new line in api.mustache + add space after if
* run ./bin/nancyfx-petstore-server.sh and ./bin/nancyfx-petstore-server-async.sh
* [Rust] Use serde Value for objects
This hopefully fixes the previous TODO; it at least fixes compilation
errors for the specific swagger model I'm working with.
* [Rust] Update Cargo.toml to specify versions
Letting the version float freely is scary, to say the least.
This gives it a better chance at being future-proof.
When the crate author had a recommended selector I picked that,
otherwise I went semver compatible.
* [Rust] Regenerate the example
* Add addiitional files from upstream
* Remove mis-added files
* Swift3: Properly percent-escape path parameters
This change fixes the following issue:
https://github.com/swagger-api/swagger-codegen/issues/6400
The problem was that path parameters were not properly percent-escaped before being placed into the URL path. This leads to creation of an invalid URL, which then fails.
So therefore, in the API template where path parameters are handled, we propertly percent escape them, using the characters which are allowed in URL paths.
In addition to this template change, then this PR includes the following changes:
1. Resulting changes in all generated code due to the above template change.
2. I added the objcCompatible run to the swift3-petstore-all.sh so that I could re-generated all of the generated code with a single script.
3. I added a unit test in UserAPITests.swift which verifies that paths are properly escaped.
4. In order to make the unit test work, then I needed access to RequestBuilder<T>.URLString to verify that the path was properly escaped. However, RequestBuilder<T>.URLString had "internal" access control so it was inaccessible from the unit test. So therefore, I made four contants in RequestBuilder<T> to be public. This should not harm anything, since they are constants ("let's") and cannot be changed from the outside of the class after initialization.
5. There were also some stray changes which look like they were caused by having not run bin/swift3-petstore-all.sh in a while.
* [Elixir Client] Update the sample
It just executes
% bin/elixir-petstore.sh
without any code changes.
It have been affected by updating the sample swagger specification of 07b408a44a
* [Elixir Client] Fix typings in RequestBuilder
Fix following dialyzer warnings in the sample:
```
lib/swagger_petstore/api/another_fake.ex:30: Function test_special_tags/2 has no local return
lib/swagger_petstore/api/another_fake.ex:30: Function test_special_tags/3 has no local return
lib/swagger_petstore/api/another_fake.ex:32: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'patch') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/fake.ex:29: Function fake_outer_boolean_serialize/1 has no local return
lib/swagger_petstore/api/fake.ex:29: Function fake_outer_boolean_serialize/2 has no local return
lib/swagger_petstore/api/fake.ex:34: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'post') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/fake.ex:57: Function fake_outer_composite_serialize/1 has no local return
lib/swagger_petstore/api/fake.ex:57: Function fake_outer_composite_serialize/2 has no local return
lib/swagger_petstore/api/fake.ex:62: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'post') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/fake.ex:85: Function fake_outer_number_serialize/1 has no local return
lib/swagger_petstore/api/fake.ex:85: Function fake_outer_number_serialize/2 has no local return
lib/swagger_petstore/api/fake.ex:90: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'post') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/fake.ex:113: Function fake_outer_string_serialize/1 has no local return
lib/swagger_petstore/api/fake.ex:113: Function fake_outer_string_serialize/2 has no local return
lib/swagger_petstore/api/fake.ex:118: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'post') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/fake.ex:142: Function test_client_model/2 has no local return
lib/swagger_petstore/api/fake.ex:142: Function test_client_model/3 has no local return
lib/swagger_petstore/api/fake.ex:144: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'patch') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/fake.ex:181: Function test_endpoint_parameters/5 has no local return
lib/swagger_petstore/api/fake.ex:181: Function test_endpoint_parameters/6 has no local return
lib/swagger_petstore/api/fake.ex:195: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'post') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/fake.ex:230: Function test_enum_parameters/1 has no local return
lib/swagger_petstore/api/fake.ex:230: Function test_enum_parameters/2 has no local return
lib/swagger_petstore/api/fake.ex:242: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'get') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/fake.ex:266: Function test_inline_additional_properties/2 has no local return
lib/swagger_petstore/api/fake.ex:266: Function test_inline_additional_properties/3 has no local return
lib/swagger_petstore/api/fake.ex:268: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'post') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/fake.ex:293: Function test_json_form_data/3 has no local return
lib/swagger_petstore/api/fake.ex:293: Function test_json_form_data/4 has no local return
lib/swagger_petstore/api/fake.ex:295: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'get') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/fake_classname_tags123.ex:29: Function test_classname/2 has no local return
lib/swagger_petstore/api/fake_classname_tags123.ex:29: Function test_classname/3 has no local return
lib/swagger_petstore/api/fake_classname_tags123.ex:31: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'patch') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/pet.ex:30: Function add_pet/2 has no local return
lib/swagger_petstore/api/pet.ex:30: Function add_pet/3 has no local return
lib/swagger_petstore/api/pet.ex:32: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'post') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/pet.ex:57: Function delete_pet/2 has no local return
lib/swagger_petstore/api/pet.ex:57: Function delete_pet/3 has no local return
lib/swagger_petstore/api/pet.ex:62: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'delete') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/pet.ex:86: Function find_pets_by_status/2 has no local return
lib/swagger_petstore/api/pet.ex:86: Function find_pets_by_status/3 has no local return
lib/swagger_petstore/api/pet.ex:88: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'get') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/pet.ex:112: Function find_pets_by_tags/2 has no local return
lib/swagger_petstore/api/pet.ex:112: Function find_pets_by_tags/3 has no local return
lib/swagger_petstore/api/pet.ex:114: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'get') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/pet.ex:138: Function get_pet_by_id/2 has no local return
lib/swagger_petstore/api/pet.ex:138: Function get_pet_by_id/3 has no local return
lib/swagger_petstore/api/pet.ex:140: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'get') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/pet.ex:163: Function update_pet/2 has no local return
lib/swagger_petstore/api/pet.ex:163: Function update_pet/3 has no local return
lib/swagger_petstore/api/pet.ex:165: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'put') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/pet.ex:191: Function update_pet_with_form/2 has no local return
lib/swagger_petstore/api/pet.ex:191: Function update_pet_with_form/3 has no local return
lib/swagger_petstore/api/pet.ex:197: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'post') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/pet.ex:223: Function upload_file/2 has no local return
lib/swagger_petstore/api/pet.ex:223: Function upload_file/3 has no local return
lib/swagger_petstore/api/pet.ex:229: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'post') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/store.ex:30: Function delete_order/2 has no local return
lib/swagger_petstore/api/store.ex:30: Function delete_order/3 has no local return
lib/swagger_petstore/api/store.ex:32: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'delete') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/store.ex:54: Function get_inventory/1 has no local return
lib/swagger_petstore/api/store.ex:54: Function get_inventory/2 has no local return
lib/swagger_petstore/api/store.ex:56: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'get') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/store.ex:79: Function get_order_by_id/2 has no local return
lib/swagger_petstore/api/store.ex:79: Function get_order_by_id/3 has no local return
lib/swagger_petstore/api/store.ex:81: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'get') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/store.ex:104: Function place_order/2 has no local return
lib/swagger_petstore/api/store.ex:104: Function place_order/3 has no local return
lib/swagger_petstore/api/store.ex:106: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'post') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/user.ex:30: Function create_user/2 has no local return
lib/swagger_petstore/api/user.ex:30: Function create_user/3 has no local return
lib/swagger_petstore/api/user.ex:32: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'post') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/user.ex:56: Function create_users_with_array_input/2 has no local return
lib/swagger_petstore/api/user.ex:56: Function create_users_with_array_input/3 has no local return
lib/swagger_petstore/api/user.ex:58: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'post') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/user.ex:82: Function create_users_with_list_input/2 has no local return
lib/swagger_petstore/api/user.ex:82: Function create_users_with_list_input/3 has no local return
lib/swagger_petstore/api/user.ex:84: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'post') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/user.ex:108: Function delete_user/2 has no local return
lib/swagger_petstore/api/user.ex:108: Function delete_user/3 has no local return
lib/swagger_petstore/api/user.ex:110: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'delete') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/user.ex:133: Function get_user_by_name/2 has no local return
lib/swagger_petstore/api/user.ex:133: Function get_user_by_name/3 has no local return
lib/swagger_petstore/api/user.ex:135: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'get') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/user.ex:159: Function login_user/3 has no local return
lib/swagger_petstore/api/user.ex:159: Function login_user/4 has no local return
lib/swagger_petstore/api/user.ex:161: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'get') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/user.ex:185: Function logout_user/1 has no local return
lib/swagger_petstore/api/user.ex:185: Function logout_user/2 has no local return
lib/swagger_petstore/api/user.ex:187: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'get') breaks the contract (map(),'Elixir.String':t()) -> map()
lib/swagger_petstore/api/user.ex:211: Function update_user/3 has no local return
lib/swagger_petstore/api/user.ex:211: Function update_user/4 has no local return
lib/swagger_petstore/api/user.ex:213: The call 'Elixir.SwaggerPetstore.RequestBuilder':method(#{},'put') breaks the contract (map(),'Elixir.String':t()) -> map()
```
* Add configuration to split input and output bean validations. When useBeanValidation is used, the variable are created in the application.conf file and can be tweaked by environment. For example, dev and stage can have true to both but only have input in prod.
* Refactor of mustache tags for more clarity
* sample generation with refactor
* Fix a couple of bugs with the fake-endpoint yaml but there is still 2 cases where it doesn't work.
* Remove Accept request header from api signature
* Inject HttpServletRequest to get request header and clean templates
* Use constructor injection for HttpServletRequest
* Implement example in default controller responses
The linting results for the generated samples are as follows
where the first number is the BEFORE and the second is AFTER.
flaskConnexion 1843 vs. 20
flaskConnexion-python2 1841 vs. 19
For the complete details please see the following gist.
https://gist.github.com/kenjones-cisco/edc9d71ef7fd2bf23714ecbb693d52b3
Enable the creation of the entrypoint so that the server can be started
using a named command instead of needing to always use `python -m` to
run the server.
* Added forRoot and constructure duplicate check
* added imports
* updated providers display format
* updated examples
* Moved providers so users don't hav eto use forRoot if they don't want.
* Updated the readme
* [angular-typescript] imports HttpClientModule
HttpModule has no effect, since the new `HttpClient` is now used. fixes#6727
* #6727: import http client module or http module, depending on setting
* #6727: import http client module or http module, depending on setting
* #6727: generate samples
* Added v4/v4.3 to typescript-angular-petsotre-all and renamed from angular2 to angular
* refactored typescript-angular-petstore-all.sh
* changed profile id for typescript-angularjs to properly have angularjs instead of just angular.
* Spacing at end of model template
* Corrected backwards compatible enum typing
* Removed commented code
* Input validation is now supported as strict JSON validation
* [PHP][Symfony] Improve the implementation
Closes#6614
* Generated code is tested to assure it compiles and updated README to dynamically load dependencies via composer
* Updated shell script because shippable tests were failing
* Replaced the method for updating path to prep for URL encoding.
The new method will switch TypeScript-Angular variables from snake_case to camelCase in the URL generation.
Imported StringBuffer, Matcher, and Pattern, since the new solution needs them.
Some extra whitespace on blank lines was removed.
* Since these were not up to date with the current master, I ran them and am commiting them here.
This way, the changes are shown here instead of after future commits.
* Simplified the code for the path conversion A LOT.
New version is much simpler to follow, and very efficient - only one iteration through the length of the string.
Removed regex Matcher and Pattern classes, since they weren't needed anymore.
* 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
* Inclusion of API documentation in CXF Server stub generation
* Inclusion of API documentation in CXF client generation
* Update of the Petstore CXF server sample
* Update of the Petstore CXF client sample
* Update of the Petstore CXF server annotated base path sample
* Update of the Petstore CXF server non spring application sample
* Changed {{{appDescription}}} to {{appDescription}} to use the HTML-escaped value in handling special characters like <, > in the description following the correction made by @wing328
* Update of the Petstore CXF samples
* Rust API client/server generator
* `Future::boxed()` has been deprecated - replace with `Box::new(...)`
* rebasing to rust
* MMMLS211 use empty vec over none
* MMMLS211 rebuild after merge from rust
* MMMLS211 YAML array examples not wrapped in Some()
* MMMLS211 Array parameters bad mustache fix
* MMMLS211 don't parse map containers
* MMMLS211 Tidy container types
* MMMLS-211 rebuild example
* MMMLS211 mvn rebuild
* Percent-decode parameters contained in the path
* Produce warnings when unknown fields are present
We still accept unknown fields and discard them. However, to improve
diagnosability, we now write a warning log and return a `Warning`
header.
Note that this is server-only
* Markup
* MMMLS211: Make optional arrays Options again
* 211 markups
* Temporary attempt at tweaking Cow ownership tweak while merging changes from rust branch
* Remove to_string call while parsing path parameters, which requires definining a temporary var in a block because rust can't tell where a Cow reference gets dropped
* Fix rustfmt to the correct version
* Fix rustfmt to the correct version
* Add more response information to ApiError in client
* Re-add missing brace
* Code review markups
* Allow converting out of wrapper types
* Store arrays in new-types too
* Use a new hyper_client every request
* Add vec-like traits to array types
* Xml support - new branch
* Moved conversion from serde_xml_rs::Error to ApiError from swagger-rs to client code until upstream PR is accepted
* MMSUB-172 Don't set Content-Type when there's no body.
If we don't have a body we've serialized, then don't declare
any content type for the nonexistent body.
This is really important for 204 No Content responses, but it's
also morally important for all other non-bodied responses.
* MMSUB-172 Move to swagger 0.6.
* Manually implement debug for the client
* Allow `Context` to be bound to `Api`, and not passed on every function call
* Support "." in parameter names
* Support generate's "--reserved-words-mappings" option
* Support "." in parameter names
* Support generate's "--reserved-words-mappings" option
* Included Open Systems International in the list of companies using Swagger Codegen
* Force Jackson to use the real names of the properties of the Data type defined in the YAML
* Update of the Petstore CXF server sample
* Update of the Petstore CXF client sample
* Update of the Petstore CXF server annotated base path sample
* Update of the Petstore CXF server non spring application sample
* Changed {{name}} for {{baseName}} following the correction posted by @wing328
* Update of the Petstore CXF server sample
* ContentType selection fix for csharp.
Updated to reflect java implementation. Previously any request body of type string was having the content type overridden to 'application/json'. This prevented custom json ContentTypes
* updated the petshop codegen for C#
* Fixed content type selection test for csharp
* Replaced tabs with 4 spaces
* Removed trailing space / string comparison
* [Elixir Client] Improve primitive typings
* [Elixir Client] Add type to models
Fix following dialyzer warnings in the sample:
```
:0: Unknown type 'Elixir.SwaggerPetstore.Model.ApiResponse':t/0
:0: Unknown type 'Elixir.SwaggerPetstore.Model.Client':t/0
:0: Unknown type 'Elixir.SwaggerPetstore.Model.Order':t/0
:0: Unknown type 'Elixir.SwaggerPetstore.Model.OuterBoolean':t/0
:0: Unknown type 'Elixir.SwaggerPetstore.Model.OuterComposite':t/0
:0: Unknown type 'Elixir.SwaggerPetstore.Model.OuterNumber':t/0
:0: Unknown type 'Elixir.SwaggerPetstore.Model.OuterString':t/0
:0: Unknown type 'Elixir.SwaggerPetstore.Model.Pet':t/0
:0: Unknown type 'Elixir.SwaggerPetstore.Model.User':t/0
```
* Adding a Scalaz codegen client
* Fixing imports and removing commented code
* Adding the bash file and updating the Pet store samples for Scalaz.
* Finalizing Scalaz generation so that it works for the Petstore.yaml
* Removing some unnecessary files and comments
* Removing some files that were accidentally generated for the wrong Scala
* Added support for enums in Dart.
* Pick non-private names for enum values.
The _ prefix denotes a private member in Dart, so avoid generating enum values starting with this character.
* Properly encode enum values into query paramters.
* Various cleanups.
* Add support for x-enum-values extension.
Use class instead of enum for better ergonomy.
Better generated enum names.
* Fixed test.
* Support enum descriptions.
* Updated api client, Required parameters {{#required}} .. {{/required}}, are mapped to Eiffel
Void Safety Rules, optional parameters are translated to detachable TYPE.
Validation Rules are mapped to preconditions, at the moment maximun and minimun
validation has been added.
Improved API_CLIENT.parameter_to_tuple feature to accept a LIST [ANY] instead of LIST [STRING_32].
Improved model template to generate the model output.
* Updated API_CLIENT.parameter_to_string feature, missing STRING representation.
* Updating sample using the latest modifications.
* Add addiitional files from upstream
* Remove mis-added files
* Add additional swift4 initializer for initializing model object with properties.
This change fixes this issue: https://github.com/swagger-api/swagger-codegen/issues/6641
It adds an additional initializer which allows model objects to be initialized using the properties. For exxample, if we had this model:
"ErrorInfo": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Example Error object"
},
This we generate an initializer for this model object like this:
public init(code: Int?, message: String?, details: [String]?) {
self.code = code
self.message = message
self.details = details
}
* Add hasVars checks around initializers and re-run all scripts to re-generate
* Add addiitional files from upstream
* Remove mis-added files
* Fix compilation issue with Swift4 inline enums.
This change fixes this issue: https://github.com/swagger-api/swagger-codegen/issues/6607
The problem was that I was using "datatype" instead of "datatypeWithEnum" in the model.mustache file.
When you have a the following model property:
"myInlineStringEnum": {
"type": "string",
"enum": [
"inlineStringEnumValue1",
"inlineStringEnumValue2",
"inlineStringEnumValue3"
]
}
Then we were generating:
public enum MyInlineStringEnum: String, Codable {
case inlinestringenumvalue1 = "inlineStringEnumValue1"
case inlinestringenumvalue2 = "inlineStringEnumValue2"
case inlinestringenumvalue3 = "inlineStringEnumValue3"
}
However, when we decode this, we were using type of the enum ("datatype") rather than the enum type itself ("datatypeWithEnum"). So we were generating:
myInlineStringEnum = try container.decodeIfPresent(String.self, forKey: "myInlineStringEnum")
rather than:
myInlineStringEnum = try container.decodeIfPresent(MyInlineStringEnum.self, forKey: "myInlineStringEnum")
* Adds the ability to create code for an interface-based jaxrs client.
* Adds shell script and sample files for jaxrs-spec-interface
* rebase into adds shell
* Fixes bug in creation of Produces/Consumes in method annotation. Allows for instance "application/json; charset=utf-8"
* Fixes generated pom.xml
* Generate pom.xml by default
* Prettier output from api.mustache
* Fixes bug in mediatype, allowing charset-specification in swagger.yaml.
* Merges generation of interface-based jaxrs client/api into jaxrs-spec.
* Moves jaxrs-spec server interface to match location of jaxrs-spec server
* Makes Generated-annotation in genereated classes slightly prettier.
* Add Ada client petstore samples
- Add script to generate Ada client support with swagger-codegen
- Add files to build the Ada sample
- Add main program to use the generated client samples API
and connect to the server to perform some operations
* Add some description for the samples
* Update the documentation to explain how to build, how to use the generated Ada client code
* represent swagger enums as union of literal types
enabling their easy use in angular templates, structural subtyping
among enums (in particular, different instances of the same enum
are now mutually assignable), improving type safety by preventing
incorrect widening, and permitting numeric enum values
(albeit without descriptive names)
Fixes#6206, #5146, #3500
* update samples
* restore blank lines at end of file
* fix typo
* Add support for lists of path parameters (eg instances), and default params for optional case classes
* Update Petstore sample
* Revert defaulting of case class fields to None
* Update Petstore sample
* add support for auth methods
* use newtypes for required params
* fix duplicate operationId issues
* prevent aliasing of vendorextension references in fromOperation
* add --fast to stack ci build
* [objc] Update deployment target to 8.0
Updates the test project deployment target to 8.0, as that's the lowest
supported by the latest XCode.
* [objc] Update petstore tests based on current master
Makes sure the tests are based on the latest version of master.
* [objc] Allow specifying the serialization timezone
Now it's possible to specify the timezone used for serializing dates
* Add test which reproduce the warning #5338https://github.com/swagger-api/swagger-codegen/issues/5338#issuecomment-292502895
`[main] WARN io.swagger.codegen.languages.PhpClientCodegen - Type object not handled properly in setParameterExampleValue`
* Fix Type object not handled properly in setParameterExampleValue
* Update samples
- /bin/php-petstore.sh
- /bin/security/php-petstore.sh
* Added namespace mustache to be generated
* Fixed syntax issues with package generation
* Added Response and Element mustache templates
* Added ApiClient
* Fix: Only required parameters needed for api operations
* Added documentation generated code
* Regenerated petstore samples
* Fixed url paths for operations
* Fixed based on comments in issues #6520
* Regenerated petstore samples
* CsharpDotNet2Client - Use clientPackage in additionalProperties if provided
* Give execution rights for csharp-dotnet2-petstore.sh
* Fix generation of C#.net2 apiPackage, modelPackage, clientPackage
* Fix modelPackage property missing when generating models
* Initialize clientPackage in constructor
* Retrofit2: Return ResponseBody if response if file.
Until now
--------------------
If a swagger endpoint returned a file (e.g. an image), then the Retrofit2
template has choosen the return type java.io.File. However, retrofit cannot
deal with this and throws a com.google.gson.stream.MalformedJsonException.
New:
-------------------
If a swagger endpoint returns a file, then the corresponding Retrofit2 endpoint
will return a okhttp3.ResponseBody which can be used to retrieve the file.
* fix Interface Prefix
* Retrofit2: Return ResponseBody if response if file.
Until now
--------------------
If a swagger endpoint returned a file (e.g. an image), then the Retrofit2
template has choosen the return type java.io.File. However, retrofit cannot
deal with this and throws a com.google.gson.stream.MalformedJsonException.
New:
-------------------
If a swagger endpoint returns a file, then the corresponding Retrofit2 endpoint
will return a okhttp3.ResponseBody which can be used to retrieve the file.
* Add the option packageContext for nancyFx which allows a better adjustment of the namespace.
* run nancyfx-petstore-server.bat
* fix compilation error in eclipse
by updating package declarations in moved files
(eclipse validates that package and folder names match)
* permit specifying the full angular version
simplifying the templates by moving trivial case splits to the model
* remove dead code
this method is never called ...
* support HttpClient in addition to Http, clean up generated code
Fixes#6080
* added new sample, and regenerated existing samples
* updated samples
this time with the freshly build generator ...
* improve formatting
* updated samples
* fix compilation error in generated code
the overload for blobs does not have a type parameter
* added the first test for the utils package
* fix extra trainling commas in function argument lists
* regenerated samples
* Adding support for non dictionary body types.
* Adding test for rest of the swift3 types
* Cleaning up implementation of makeRequest and adding better error handling.
* Adding ClientError for error produced before request is sent.
* Changing how encoding of body data is handled.
* Cleaning up code that was modified.
A previous change to make the regex a variable to allow proper linting
resulted in the regexp not having access to the value associated with
the variable and the path variable not being replaced.
Moves the regexp variable inside the for loop to allow the value to be
used and the path variable to be replaced with the provided value.
* Fix dependencies and generate model classes
* Better elixir client generation.
Responses are parsed and serialized by Poison into the model structs.
Use shared helper functions to generate the request.
Extract client connection configuration from api calls.
Elixir client can sanitize the operationId
Correctly output the model variables. Fix typos
Fix path replacement when there are multiple replacements
Cannot separate globally shared parameters from operations
Error handling for the tesla response
update templates
Can generate clients that compile
Can make requests - parse optional params, build query
Add oauth to connection. Fix connection directory
Add basic auth helper for creating a connection
Fix map types. Fix guard clauses for creaing connections
Add licenceInfo template. Parse config for moduleName via standard invokerPackage option
Can provide and inject a license header into all source files
fix location of connection.ex
Move shared code into reusable modules
Elixir filenames should be underscored
Fix visibility of helper functions
Parse the packageName from config options
Handle date and datetime fields with DateTime.from_iso8601
Fix indentation
Update documentation, add typespecs
Generate a standard elixir .gitignore
typespec is calculated recursively in java
Use the JSON middleware and using Poison.Decoder.decode on already parsed structs
move decoded struct into java
Fix handling of non-json responses
Switch basic auth to use the provided Tesla.Middleware.BasicAuth
Update README template to include the appDescription
Update sample elixir client
remove junk client models that don't belong with petstore
Only implement Poison.Decoder protocol if needed
Update samples with skipped Poison.Deocder impl
* Handle multipart file uploads
Handle building form params in the body
Files are handled as strings for input
* Requests with no defined return type will return the Tesla.Env response
* Run the bin/elixir-petstore.sh
* * Fix bugs in api.mustache, model.mustache, mostly bracket errors or small typos
* Added section about installation in README.mustace
TODO: fix tests in testthat
TODO: fix bug in description.mustace regarding package name
* Updates to sample for R client caused by running ./bin/r-petstore.sh (or .\bin\windows\r-petstore.bat)
* Add R specific files to .gitignore
* [R] add additional files generated by the petstore sample. (see #6520)
The only special handling was for security definition type `apiKey`
in `query`. All the other security configurations should result in the
same generated code.
Moves the handling of the special query parameters outside of the
`parameters without specific cardinality` section.
To cover the scenario where `elif` was being used, simply leverage the
builtin `continue` statement to stop processing the specific query
parameter and continue to the next available query parameter, if any.
Manually test with multiple different combinations.
Resolves: #6526
* Update samples
./bin/php-petstore.sh
* Remove unnecessary implements entry
ModelInterface, ArrayAccess are already implemented in parent
* Remove field `container` which is already defined in parent
* Change snake case to lower camel case
- invalid_properties
- allowed_values
* Improve doc commenct style
* Improve description length
* Improve length
* Doc comment short description must start with a capital letter
* Add a line between @param and @return
* Delete an additinal blank line at end of doc comment
* Udpate petstore-security-test
* upgraded zend-expressive from version 1 to 2
* Changed error handler for compatibility with Zend Expressive 2
* generated newest sample files for Petstore ze-ph
* removed ErrorMiddleware because it is never been used anymore. Regenerated samples
* removed ErrorMiddleware Template from Codegen
* remove ErrorMiddleware from petstore sample
* Fixed some code styles
* regenerated ze-ph samples with corrected code styles
* added new line at the end of the file