Commit Graph

3575 Commits

Author SHA1 Message Date
Stephane Carrez
362625bfa9 [Ada] Add Ada support for server code generator #6680 (#7256)
* 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
2018-01-07 18:44:20 +08:00
Ben Wells
7479fc5361 Generate swagger yaml for go client (#7281) 2018-01-07 11:37:40 +08:00
Jean-François Côté
0a9c6f56c8 Fix issue #7262 with the parameter name in the path. The problem was that camelCase naming was forced only in this part of the code when everywhere else it is configurable. (#7313) 2018-01-07 10:33:46 +08:00
manuc66
a050907d1f fix net35 with JsonSubTypes (#7043)
* upgrade JsonSubTypes to 1.2.0

* update samples

* add SwaggerClientNet35

* re-generate

* fix the linux build script
2017-12-22 00:31:44 +08:00
William Cheng
587dc20e06
[Javascript] Set ES5 as default (#7239)
* default js client to es5

* update js option wording
2017-12-22 00:08:30 +08:00
Ramzi Maalej
9dde8525ec [Akka-Scala] This is a fix to a bug introduced by this PR #7172 (#7228)
* Add missing import

* Update petstore app
2017-12-21 10:56:36 +08:00
Erik Timmers
d6539ba3c8 Add Elm language - BETA (#6947)
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.
2017-12-20 22:26:46 +08:00
Jon Schoning
538f28e568 bump stack resolver to lts-10.0 (#7221) 2017-12-20 21:55:23 +08:00
William Cheng
350a97095b
[Go] rename local variable "file" to "localVarFile" (#7214)
* comment out pkmst test for the time being

* rename file to localVarFile
2017-12-19 23:12:12 +08:00
Asad Saeeduddin
a3ca8d55e2 [TypeScript-Fetch] Support for non-JSON body params (#6994)
* 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
2017-12-19 17:20:16 +08:00
antihax
dc69138de5 Go: Return error body with >= 300 errors (#7192)
* Report better errors

* update tests
2017-12-18 23:03:47 +08:00
Ben Wells
6349e79a59 Fix typo in Petstore yaml (#7195) 2017-12-18 12:30:57 +08:00
wing328
1d44bb8141 update spring petstore samples 2017-12-15 00:02:43 +08:00
Jean-François Côté
e70bdf17f2 [Typescript All] Prevent usage of reserved keyword for model fields (#7112)
* 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.
2017-12-14 12:47:02 +08:00
William Cheng
c774e98464
update swagger parser, core version the latest (#7163) 2017-12-13 18:08:26 +08:00
Bartek Kryza
8b61b1d466 #7047 - Added Bash syntax check to tests (#7155) 2017-12-13 11:14:07 +08:00
Ville Skyttä
794bb07cf7 Spelling fixes (#7142) 2017-12-10 10:48:30 +08:00
wing328
e7b97383d1 update php petstore samples 2017-12-09 17:32:45 +08:00
Krzysztof Karol
d43e9c8be2 Fix wrong params indentation (#7136) 2017-12-09 17:22:24 +08:00
Akihito Nakano
cfa5a55a28 [PHP] Improve StoreApiTest (#7141)
* Move the test code to the appropriate test case

* currently, InvalidArgumentException will be thrown

* Remove unnecessary tests at this time

* Unify into single quotes
2017-12-09 17:01:25 +08:00
Benjamin Gill
1a831f73f3 [rust-server] Plaintext support; encode params (#7082)
* 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
2017-12-08 18:42:14 +08:00
Oliver Hoffmann
20f48b04fc Make efficient use of entrySet iterator. (#7105) 2017-12-08 00:35:11 +08:00
wing328
365f3a923b update php petstore samples 2017-12-08 00:32:53 +08:00
Jinkui Shi
01b6330202 [Scala] [ISSUE-7085] Scala template code format refactor (#7086)
* [Scala] [ISSUE-7085] Scala template code format refactor

* upgrade scala version to 2.11.12 and upgrade dependency version
2017-12-08 00:20:19 +08:00
Akihito Nakano
1ff3b00ac5 [PHP] Add generator version (#7124)
* Add generator version

* Update samples

- bin/php-petstore.sh
- bin/security/php-petstore.sh
2017-12-08 00:02:52 +08:00
wing328
fb69703fe0 update ruby petstore samples 2017-12-07 23:55:51 +08:00
topce
b0f61f394c fix issue 7048 (#7108) 2017-12-07 23:50:26 +08:00
Jean-François Côté
40f1de8a58 [Typescript jQuery] Add README.md (#7113)
* 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
2017-12-06 10:34:29 +08:00
Ramzi Maalej
61e706ba6f [Akka-Scala] Add build.sbt to Akka-scala (#7076)
* Add build.sbt to Akka-scala

* Add readme.md and build.sbt to petstore sample
2017-12-01 12:03:10 +08:00
antihax
831e8d7c87 [Go] Add context to all requests for tracing, logging, cancellations, etc. (#6997)
* Add context to all requests for tracing, logging, cancellations, etc.

* Fix compile error with when call has no parameters.
2017-11-30 00:30:35 +08:00
ehyche
d2a2292d20 Update samples using latest codegen and templates (#7071) 2017-11-29 14:49:45 +08:00
wing328
80cc90c7c1 update spring petstore samples 2017-11-29 11:19:46 +08:00
wing328
9a95f2f36b update swift petstore samples 2017-11-28 23:44:49 +08:00
Tomasz Prus
efe16fda8c [python/tornado] ssl improvements (#7061) 2017-11-28 10:06:29 +08:00
wing328
55410a3d4a update spring petstore sample 2017-11-27 22:12:46 +08:00
Ben Mordue
02bcc55e23 Do not apply content-type header if no request body (#6648)
* 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
2017-11-27 18:33:28 +08:00
wing328
088eef5927 update petstore samples 2017-11-27 17:16:44 +08:00
Greg Marzouka
75c2d5ed4c [Scala] Default Option parameters to None (#6538)
* Add sensible defaults for not required params in scala

* Also default to None for async methods
2017-11-27 17:06:28 +08:00
Tristan Sloughter
3d3a30a533 [Erlang] erlang client: properly handle optional parameters (#7042)
* erlang client: properly handle optional parameters

* [Erlang Client] handle multiple path params in the same path
2017-11-27 16:11:14 +08:00
topce
8a0de971e4 Remove rxjs operators (#6989)
* do not import rxjs-operators if using HttpClinet

* generate code

* do not import operators if they are not needed
2017-11-24 13:24:46 +08:00
Keni Steward
8eb33f9d1b [Typescript][Angular]Issue #6902 Return Client Response for Angular 4.3 and above with Observe string (#6955)
* 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
2017-11-24 01:50:07 +08:00
Oliver Hoffmann
10107ac7ec Upgrade to resteasy-jackson2-provider (#7017)
* Upgrade to resteasy-jackson2-provider

* Upgrade to resteasy-jackson2-provider
2017-11-23 17:35:49 +08:00
Lukasz Konopski
0f92baeb04 Inheritance support java client okhttp gson (#6636)
* #6636 inheritance support for java client okhttp with gson parser

* #6636 generate samples
2017-11-22 21:28:13 +08:00
François Rosé
acefe3f385 [CppRest] Add Object and fix modelbase includes (#6905)
* 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.
2017-11-22 12:19:13 +08:00
François Rosé
d9cea0f97e [CppRest] Support optional parameters (#6959)
* Use boost::optional for parameters that are not required.

* Update sample petstore client.
2017-11-22 12:13:05 +08:00
Daiki Matsudate
a5e4abe5ec [Swift4]Update templates for swift 4 (#6921)
* 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
2017-11-21 11:33:52 +08:00
manuc66
b06ccec11e [csharp] Update JsonSubTypes to 1.1.3 and use nuget dependency (#6969)
* 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
2017-11-21 11:26:58 +08:00
topce
04ee374328 [TypeScript][Angular] fix problem with strict compilation (#6978)
* fix probelme with strict compilation

* commit generated files
2017-11-21 01:21:45 +08:00
wing328
404b526dbe update resttempalte java petstore samples 2017-11-21 00:48:39 +08:00
William Cheng
ec0da35b6c
regenerate package.json, tsconfig.json for ts node (#6987) 2017-11-18 21:05:19 +08:00