* [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 async helper methods when body is optional (#7274)
* [Scala] Fix async helper methods when body is optional
Closes#7272
* Update petstore sample
* Standardize all isRestfulxxx methods.
Change 'equals' method to 'equalsIgnoreCase' for isRestfulIndex method in Operations. This matches isRestfulCreate, isRestfulShow, isRestfulDestroy
* [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
* Make stripPackage name configurable via property
- Needed because some APIs (e.g. Kubernetes) include version information in packages. Stripping causes many generated API and model classes to be named the same, causing a last-one-wins situation which is unacceptable.
* Per PR review, ensure stripPackageName Boolean property and log warning
* 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
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
* java 8 interface only delegate method mode
* typo correction
* Update samples with ./bin/spring-all-petstore.sh
* change delegate prefix to "do" and make delegate method a default method that returns an OK status code
* remove temp debug printout
* prefix spring annotated method with "_" to indicate that is private
* resolve merge issues from Merge of remote-tracking branch 'upstream/master'
* tuned whitespace in api.mustache and re-ran spring-all-petstore.sh
* removed special spring cloud library check as it was no longer being referenced in api.mustache
re-ran spring-all-petstore.sh
* [akka-scala] template upgrade dependency version and refactor #7171
* update sbt dependencies version and add enforce plugin
* delete new to the case class
* 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
* 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
* master: (101 commits)
[Swift4] Allow for custom dateformatter to be used (#6672)
[haskell-http-client] fix bug when generating models-only (#6931)
fix typo: crediential => credential
minor typo fix
[csharp] fix enum serialization of first value (#6873)
[PHP] Improve docs and README (#6935)
Binary mode for file deserialization in python (#6936)
add python tornado test to travis
[Python/tornado] add integration tests and fix bugs (#6925)
Fix PHP passes response body to ApiException (#6923)
[TypeScript][Node] Resolve TS2532 error (#6932)
skip "all" shell script
minor formatting change
Fixes Issue #6841, Map for accessing additionalProperties is generated. (#6886)
add tsloughter as owner erlang
WIP: initial commit for Erlang client generator (#6502)
add back php client test
Switch Travis image from MacOS to Linux (#6937)
add link to ebook
[Scala] Default case class Option types to None for non-required fields (#6790)
...
* [csharp] Treat enum models consistently
C# works differently from most languages in that enums are not
considered objects. This means default(EnumType) will choose a default
of the first enum option. This isn't desirable because it breaks the
required = false functionality of swagger specs, which defines a
property which isn't required to exist in the message body.
Rather than force consumers to use enum values such as UNSPECIFIED, UNKNOWN,
NOT_SET, etc... we can treat enums as primitives. This means any
non-required enum will become Nullable<EnumType> regardless of whether
it is defined as an inline enum or a referenced enum model.
* Categorizing C# integration test for enums as general
* [csharp] Remove enum-ref integration test
* [csharp] Clean up general enum support integration test, validate different enum usage cases.
* [csharp][all] Assign one-based int to string enums
The EmitDefaultValue=false for string based enums will prevent the first
enum value from being serialized, because as 0 it is considered the
default.
This commit assigns an explicit numerical value to all non-integer
enums. This assignment has no effect on the
serialization/deserialization values, and only assigns the compiled
integer.
NOTE: This will have an effect of requiring recompilation of any code
that references the client/server models. This is because:
public enum Pet { Available }
Source files referencing Pet.Available as defined above will have a
constant 0 in place of the enum value.
public enum Pet { Available = 1 }
Source files referencing Pet.Available as defined above will have a
constant 1 in place of the enum value.
After compilation, Pet.Available in both instances lose their semantic
values and refer to the byte representation of their integral values.
For more info, see
https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/enum
* 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.
* [csharp] Treat enum models consistently
C# works differently from most languages in that enums are not
considered objects. This means default(EnumType) will choose a default
of the first enum option. This isn't desirable because it breaks the
required = false functionality of swagger specs, which defines a
property which isn't required to exist in the message body.
Rather than force consumers to use enum values such as UNSPECIFIED, UNKNOWN,
NOT_SET, etc... we can treat enums as primitives. This means any
non-required enum will become Nullable<EnumType> regardless of whether
it is defined as an inline enum or a referenced enum model.
* Categorizing C# integration test for enums as general
* [csharp] Remove enum-ref integration test
* [csharp] Clean up general enum support integration test, validate different enum usage cases.
* Attempts to fix issues that causes enums that are not generated with a class to not generate correctly
* Fixed issue with incorrectly generating enums
* 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
Enums defines as ref models have a different object structure
(CodegenModel) than those defined as inner enums (CodegenProperty). To
make these look as similar as possible, we walk all ref model enums and
reassign enumVars with the same properties inherited from the top level
CodegenProperty so CodegenModel enums can use the same templates as
inner enums.
* 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
* [kotlin] Nested enum naming fix, and naming options via CLI
* [kotlin] Add option test for enum property naming
* [kotlin] Escape all reserved/keywords for enums
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
C# works differently from most languages in that enums are not
considered objects. This means default(EnumType) will choose a default
of the first enum option. This isn't desirable because it breaks the
required = false functionality of swagger specs, which defines a
property which isn't required to exist in the message body.
Rather than force consumers to use enum values such as UNSPECIFIED, UNKNOWN,
NOT_SET, etc... we can treat enums as primitives. This means any
non-required enum will become Nullable<EnumType> regardless of whether
it is defined as an inline enum or a referenced enum model.
* 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()
```
* Correct default value for resteasy query parameters
* clean up: add default value in query params for resteasy mustache templates
.
* clean up
* add space following wing328 recommandation.
* 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
flatten methods replaces original ObjectProperty objects with new
RefProperty objects which required variables are false as default.
Newly created objects' required variables are set as the original
property.
* 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
* revert changes to fakes yaml
the yaml currently includes invalid definitions that do not exist: ('#/definitions/xmlObject').
revert to known good yaml state.
* update template creators
* 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