Commit Graph

955 Commits

Author SHA1 Message Date
William Cheng
4e8844273b
Prepare 3.3.1-SNAPSHOT (#1154)
* update version

* update petstore samples
2018-10-02 09:40:27 +08:00
William Cheng
2b87b309ad
Rename environment variable for Go to post-process file (#1091)
* renmae Go post process file env variable

* add back samples/client/petstore/c/libcurl.licence

* keep go samples up-to-date

* update go petstore samples

* update go samples without formatting
2018-10-01 21:24:32 +08:00
kemokemo
2040050e55 [Golang][go-gin-server] Fixed issue 1122 with workaround (#1141)
[Golang][go-gin-server] Fix path parameter naming
2018-10-01 15:25:14 +08:00
William Cheng
cbddb08468
Add post processing to files generated by Haskell generators (#968)
* add hfmt support (without updating the sample)

* update haskell httpclient samples with hfmt

* add code format option to haskell servant, minor bug fixes

* update code samples with hfmt

* update samples using stylish-haskell

* rename env variable

* update haskell samples with stylish-haskell

* regenerate haskell samples without stylish-haskell

* regenerate haskell servant sample

* update example-app & tests-integration for OAS2 code
2018-09-29 17:21:03 +08:00
Adam Drakeford
5aad02ed90
Fix for optional and default types (#1107) 2018-09-26 11:48:15 +01:00
kemokemo
14de289fc1 [Go] Add a generator for the gin framework (#1048)
* copy from go-server and add go-gin-server generator

* change the templates for the gin

* fix warnings of the golint tool

* fix the path of script

* add samples

* delete unnecessary comments (#1048)

* make the help message more appropriate (#1048)

* fix the link address format (#1048)

* minor improvement
2018-09-22 00:45:32 +08:00
herojan
abb2690ef5 Kotlin spring server codegen improvements (#1070)
* If required and readonly, a field should be optional. This is to allow people to get and easily put back.

* Use list instead of array, use String instead of kotlin.String etc

* Update samples

* code review: fix annotation formatting

* code review: revert change to use listOf
2018-09-21 16:14:50 +01:00
Christophe Bornet
6dc618fa3f Fix flask connexion support (#1066)
Use the dev-2.0 git branch of flask connexion to fix the generator.
This is not ideal but better than a generator not working at all.

Fix #323
2018-09-20 19:48:28 +08:00
Benjamin Gill
c0a6eaab85 Trim trailing '/' from basePathWithoutHost (#967)
* Trim trailing '/' from basePathWithoutHost

Given that the normal use is {{{basePathWithoutHost}}}{{{path}}}.

* Trim trailing '/' from contextPath
2018-09-20 19:33:31 +08:00
William Cheng
1b2f3fbfb6
Fix alias to map response (#1067)
* fix response reference to map

* update samples

* add null check for openapi
2018-09-20 19:29:33 +08:00
Brian Mooney
b7edad5cd0 Issue 1025: Kotlin generator doesn't support inheritance (#1026)
* allVars is duplicating child preoperties when models are inherited. Filter out these duplicates in the KotlinSpringServerCodegen
  * isInherited property was not being populated in the CodegenModel, re-parse the models in the KotlinSpringServerCodegen class and populate the property here
  * Add template support for Kotlin models which require inheritance from a base class to support oneOf declarations in the api yaml
  * Change optional for parameters to use Kotlins nullable
  * Update petstore api with Optional -> Nullable
2018-09-19 11:26:47 +01:00
Dec12 | Fujigon
5c794a01f8 [Java][Jersey] add @Valid when bean validation is enabled (#1019)
* fix template to add @Valid to POJO fields regarding nest, in java-jersey

* regenerate with for scr in `ls ./bin/*jersey*.sh`; do sh $scr; done

* re-generate with ./bin/openapi3/jaxrs-jersey-petstore.sh

* update api template for jersey1

* re-generate samples

* re-generate samples
2018-09-16 22:36:20 +08:00
Jérémie Bresson
fe0f2cfad6
[JaxRS-Spec] Fixes in generated pom (#1035)
* build-helper-maven-plugin to add src/gen/java as source folder
* update javax.ws.rs-api to 2.1.1
* add jackson as dependency
2018-09-14 16:59:49 +02:00
William Cheng
096ac567ce
Revert "[C++][Restbed] Fix default values for Restbed Server generator" (#1027)
* Revert "[gradle plugin] Support Gradle 4.10 (#1011)"

This reverts commit 131cf94fe4.

* Revert "[C++][Restbed] Fix default values for Restbed Server generator (#761)"

This reverts commit f29ba97e8b.
2018-09-13 09:21:39 +08:00
stkrwork
f29ba97e8b
[C++][Restbed] Fix default values for Restbed Server generator (#761)
* Start working on fixing default value in Restbed Server Api Template

* fix default value in DefaultCodegen
2018-09-13 01:13:02 +02:00
Sean Farrow
59ad12183f Update the Asp.Net core server generator to support Asp.net Core 2.1 (#1008)
* Update the .net core sdk to v2.1 and update the asp.net packages used.

* Upgrade the SwashBuckle Asp.Net Core package to v3.0.0.

* Update the AppSettings json file and add a file used in development.
Also, remove the web.config file.

* Update the program template to use the web host builder class.

* Update the startup class to use the Asp.Net 2.1 paradigms.

* Update the launch settings json file.

* Update the controller template to derive from the ControllerBase class as aposed to Controller.

* Add the SwashBuckle annotations package.

* Add the SwashBuckle.AspNetCore.Annotations namespace to the controller template.

* Update the Startup template to add comments to the Configuration property and an env parameter to the Configure method.

* Update the startup class so we don't need to inject the hosting environment.

* Update the program class to have hte recommended CreateWebHostBuilder method from asp.net core 2.1.

* Update the asp.net core pet store sample server.

* add back aspnetcore 2.0 template via option

* remove web.config for aspnet core 2.1
2018-09-12 18:42:16 +08:00
sunn
3d4c3c545b
[c++ pistache server] Support basic query handling (#943)
Support basic query handling

Add  helpers for primitive de-serialization
Remove warnings due to unneeded commas
Deserialize basic types in queries
Add dependencies chain for external libraries
Fixes wrong parameter passed to API
2018-09-12 09:53:01 +02:00
sunn
3cfcf77c88
Improvements for qt5 server (#942)
Remove beta tag
Supported nested containers
Move repetitive code to inline function
Fix docker file
Fix CMakeLists.txt when building external project
2018-09-12 09:52:00 +02:00
Adam Drakeford
1ae3403f6d [KOTLIN] [SPRING] Minor bug fixes to generator (#1001) 2018-09-11 21:41:12 -04:00
Jakob Schmutz
7596fb7119 fix circular import issue in python flask (#946)
* fix circular import issue in python flask

This is very similar change to 3678eaff87dd95348470c
All it intends to do is fix the problem of cirular imports (which was
already fixed for python) in the python flask server.

* removal of type hints in quotes
2018-09-09 23:23:06 +08:00
Christophe Bornet
825404a1df
[Spring] Fix reactive + delegatePattern option (#978) 2018-09-08 15:51:05 +02:00
Akihito Nakano
4a9b0a91aa
[PHP]Generated lumen code can contain dots in routes (#985)
* Update README

* Remove the codes checking dots contained in path

* Update samples
2018-09-07 17:37:35 +09:00
Elan Thangamani
3abeb82685 Service Virtualization Feature enhancement (#196)
* Open Virtualan API Implementation

* Menu change

* Delete .swagger-codegen-ignore

* Delete jsonbeautifier.html

* Supporting files for Virtual service setup

* CRLF removed

* Unwanted new lines are removed

* Build issues resolved

* Build issue resolved

* Removed Logger statement

* Logger removed

* Updated

* Codegen virtual services samples for petstore.yaml

* - Code Revamp and Clean up
- Maven plugin related changes
- Samples added

* Tab space removed..

* Annotation based Service virtualization

* Open API code generator changes

* Virtualan samples added with Sprint boot app.

* Build issue resolved

* Removed unwanted files

* Updated with version 3.0.3 SNAPSHOT

* Reverted the options for virtual service in global and not needed now.

* virtualan-plugin integration with open api tool.

* Updated the all review comments and removed all tab spaces.

* Updated the ReadMe generator section.

* New line removed to fix the build issue.

* Spring boot virtualan included in the spring build script

* Included in the spring-all-petstore script
2018-09-05 16:38:06 +08:00
Jérémie Bresson
66022a1f22
Update swagger-parser to v2.0.3-OpenAPITools.org-1 (#951)
* Update swagger-parser to v2.0.3-OpenAPITools.org-1
* Run bin/rust-server-petstore.sh
2018-09-04 15:46:46 +02:00
Benjamin Gill
9b38618f68
[rust-server] Restore support for nullable (#936)
* Restore support for nullable in rust-server

Accounts for changes in https://github.com/OpenAPITools/openapi-generator/pull/930. Adds a nullable field to the sample to reduce the risk of this regressing again in future.

* Add test for required nullable field
2018-09-03 13:17:27 +01:00
Yuriy Belenko
8a034ce063
[PHP] Add interface/abstract/trait helpers (#906)
* [PHP] Enhance interfaces, abstracts and traits

It would be helpful to set prefix/suffix for all interfaces, abstracts
and traits in one place. Defaults are set to follow "PSR Naming Conventions".
If user will ask we can add prefix/suffix generator options in future.
I don't see modelPrefix generator option, so I assume it's not important now.

Ref: https://www.php-fig.org/bylaws/psr-naming-conventions/

* [Slim] Refactor to use new helpers

* [Slim] Refresh samples
2018-09-02 18:21:53 +05:00
Christophe Bornet
026c26075d Use better return types for the reactive option (#913) 2018-09-02 15:49:49 +08:00
William Cheng
e5244e8c3d
Add postProcessFile, implement in Go generators to run gofmt (#929)
* add postProcessFile, implement in Go generators to run gofmt

* minor fix to docstring

* update parallel job to 3
2018-09-01 21:02:28 +08:00
William Cheng
5ad471cc6e add back overtrue/phplint to php slim 2018-08-31 20:34:06 +08:00
William Cheng
f664938d8e add back phplint tool: e75b115 2018-08-30 19:57:22 +08:00
William Cheng
9e45fbb13b Merge branch '3.3.x' of https://github.com/openapitools/openapi-generator into 3.3.x 2018-08-30 19:48:01 +08:00
William Cheng
3b2951b305 Merge remote-tracking branch 'origin/master' into 3.3.x 2018-08-30 19:39:09 +08:00
Jérémie Bresson
f4d7403ed6 [Java][JAXRS] improve generated readme (#920)
* [Java][JAXRS] improve readmes

* Update samples

* Update jersey readme

* Update jersey examples
2018-08-30 14:05:34 +08:00
Adam Drakeford
8689227b3e [KOTLIN] Spring Boot Server Generator (#820)
* Kotlin Spring initial bootstrap

* Basic configuration construction for Kotlin Spring

* Wired up with comand line client

* Initial kotlin spring boot application generated using gradle kotlin-dsl

* Added basic support for generating models

* Basic controllers generated without endpoints generated

* Basic spring boot app generated with models and controllers

* Added fix for type mapping in AbstractKotlinCodegen. Originally it was mapping list o kotlin.Array instead of kotlin.collections.List

* Fixed return type mapping

* Sorted bash springboot petstore generator script

* Implemented toVarName in AbstractKotlinCodegen to better handle some edgecases

* Checking for reserved words or numerical starting class names in AbstractKotlinCodegen

* Implemented toOperationId in AbstractKotlinCodegen

* Fixed types that were not correctly being mapped to primitives (byte / arrayOf / mapOf)

* Escaping dollar symbols in function names

* Added support for outter enum classes

* Added basic support for generating services

* Removed option for generated config package. Added option to enable/disable generated global exception handler

* Added configuration option to generate gradle. Generated maven pom.xml file as default

* Fixed up bash scripts for generating test sample code

* Added configurable option for Swagger Annotations

* Added configurable option for generating service interfaces and service implementations

* Added README generation

* Enable optional bean validation

* Added kotlin spring sample to CircleCI pom.xml

* Removed kotlin spring boot from .gitignore

* Minor fixes from PR comments for user submission (#1)

* Minor fixes from PR comments for user submission

* Puts braces around conditional block bodies with one-liner bodies.
* Modifies README.mustache to use artifact id and version supplied by
user (or default configuration)
* Targets templates under resource directory explicitly to prevent the
need to rebuild for evaluation of  template-only changes.

* [kotlin-spring] Remove comments referencing sbt in bash scripts

* List of changes based upon code review:
* Additional comments around how we set the title based off the open api spec
* Fixed missing `beanValidationCore` template
* Put the lambdas into the lambda object as other generators do (Ktor, C#, cpp)
* Bump swagger-annotations version to latest pre-2.0 version (1.5.21)
* Set kotlin version to 1.2.60
* Updated README to set port based on template
* Added more additional properties to build bash scripts
* Removed `defaultBasePath.mustache` in place of using {{contextPath}} directly
* Log warning for when `serviceImplementation` is set t o true

* Updated samples

* Generating ConstraintViolation Exception Handler, as Springboot doesnt correctly catch the error and return bad request. Handling other exceptions a litle better

* Small fix for date time mappings (plus sample re-gen)

* Minor fix in README template, where port was using wrong variable

* Fix missing jackson-dataformat-xml dependency

* Fix build - needed to re-run kotlin-server-petstore.sh

* Fixes after merge with master

* Revert "Small fix for date time mappings (plus sample re-gen)"

This reverts commit 4152dc78b4813da71c675272ca90fb31a333aea1.

* Moved type mappings to Kotlin Spring generator

* Regenerated samples

* Regenerated samples
2018-08-27 23:54:53 +08:00
Yuriy Belenko
e75b115244
[Slim] Add PHPLint tool to check syntax (#898)
* [Slim] Add phplint package to dependencies

There is no phplint package for PHP 5.5.0 version, so I have to increase
required PHP version to 5.5.9.

* [Slim] Update main doc

* [Slim] Refresh samples
2018-08-26 15:42:59 +05:00
Yuriy Belenko
15cec0ae09
[Slim] Add PHP CodeSniffer to check coding style (#897)
* [Slim] Add PHP CodeSniffer package

* [Slim] Add phpcsStandard generator option

We follow PSR-2 coding style guide in PHP generators. It might be convenient
for users to specify own coding standard without modifying templates. That's
why I've added this option.

At first, I thought to add option validation and accept only standards from
predefined list. But this option also can be a full path to the standard's
root directory, I've changed my mind. User should use this option with caution.

Ref to all PHP CodeSniffer CLI options:
https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage

* [Slim] Extend readme with PHP CodeSniffer docs

* [Slim] Format templates to meet PSR-2

* [Slim] Refresh samples
2018-08-26 15:26:09 +05:00
Jeremie Bresson
267ffc0e2e Merge remote-tracking branch 'origin/master' into 3.3.x
Conflicts:
	modules/openapi-generator-online/Dockerfile
2018-08-26 08:26:07 +02:00
sunn
f802f8b7d7
[qt5 server] various improvements (#725)
* Improve handling of all primitive types

* Fix missing includes in case of simple APIs

* Fix minor error in template function

* Remove tabs

* Refactor code for simplicity

* Remove tabs

* rework the router for handling multiple path param

* rework router to handle multiple path parameters

* rework router to handle multiple path parameters

* rework router

* Add support for Multi path param

* Add comments to code block and remove duplicate parameters

* Remove tabs :(

* Add missing imports after resolving conflict
2018-08-24 08:47:01 +02:00
William Cheng
704c1b8893 update petstore samples 2018-08-23 18:52:34 +08:00
William Cheng
3d06900e68 Prepare 3.2.3-SNAPSHOT version (#870) 2018-08-22 13:39:20 +02:00
Michael Kotten
526e980a69 [JAXRS] use contextPath variable for @ApplicationPath in RestApplication (#850)
* Use contextPath variable for RestApplication templates
* Update generated RestApplication.java files, as they are skipped by default otherwise
* Update Petstore sample for jaxrs so that CIs can verify the change
2018-08-22 09:15:08 +02:00
Yuriy Belenko
99646e6436 [Slim] Update main documentation (#839)
* [Slim] Update main documentation

Kotlin server README has been used as a ref. There are no links to apis and
models docs, because Slim codegen doesn't provide them right now.
Also I'm not sure about white spaces, but we can change it anytime in future.

* [Slim] Refresh samples
2018-08-21 18:25:43 +08:00
OmriHarary
ca0c35aa15 [java-server] Fix improper quoting of default values for query parameters (#708) 2018-08-21 10:17:31 +02:00
Yuriy Belenko
d374e1c160 [Slim] Official htaccess (#838)
* [Slim] Change htaccess to official

Slim docs contains more simple htaccess example.
https://www.slimframework.com/docs/v3/start/web-servers.html#apache-configuration

* [Slim] Refresh samples
2018-08-21 11:59:29 +08:00
Yuriy Belenko
e605882451 [PHP] Add gitignore to AbstractPhpCodegen (#765)
* [PHP] Remove PHP related rules from root gitignore

After conversation with @ackintosh we've agreed that every PHP codegen
should create it's own `.gitignore`. Client libraries(SDKs) should ignore
`composer.lock` file while server stubs better do opposite.

* [PHP] Set .gitignore as default supporting file

* [PHP] Add default gitignore to Client SDK

* [PHP] Add default gitignore to Laravel

* [PHP] Add default gitignore to Lumen

* [PHP] Add default gitignore to Silex

Seems like issue #663 and pull request #681 missed this security script,
I've changed output path in bin/security/silex-petstore-server.sh.

* [PHP] Update Slim

* [PHP] Add default gitignore to Symfony

I've copied few old rules from root gitignore to local one. These rules
should be reviewed by original SymfonyCodegen authors.

* [PHP] Add default gitignore to Zend

* [PHP] Refresh Openapi3 client samples

* [PHP] Add refs to .gitignore templates collection
2018-08-20 12:16:01 +08:00
Matiss
dcc622d374 Improve Symfony 4.1 compatibility (#830) 2018-08-20 12:11:33 +08:00
Michael Kotten
fa52826c24 [JAXRS-spec] Add option useSwaggerAnnotations (#813) 2018-08-15 18:05:47 +02:00
Jérémie Bresson
79b993e6d5
Prepare version 3.2.2-SNAPSHOT (#810) 2018-08-14 13:38:18 +02:00
William Cheng
b64864f47d
Fix float/double default value in C# generator (#791)
* fix float/double default value

* better code format

* better CI for openapi3 batch files (C# client)

* update nancyfx samples

* pipe output to /dev/null to reduce log size

* fix windows batch file

* add C# API client generated by OAS3 spec
2018-08-13 13:28:22 +08:00
Dec12 | Fujigon
d019bbd2c7 [Java][jaxrs-jersey] add sample with jaxrs-jersey + openapi v3 (#778)
* create sample with "jaxrs-jersey" language & openapi v3

* circle ci setting

* fix typo. also add "jaxrs-jersey" to all samples profile

* artifactId conflicts. rename.

* generate samples with "./bin/openapi3/jaxrs-jersey-petstore.sh"
2018-08-10 17:24:24 +08:00