Skip to content

Conversation

@jfiala
Copy link
Contributor

@jfiala jfiala commented Jan 6, 2017

PR checklist

  • [x Read the contribution guildelines.
  • Ran the shell/batch script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates)
  • Filed the PR against the correct branch: master for non-breaking changes and 2.3.0 branch for breaking (non-backward compatible) changes.

Description of the PR

add beanvalidation annotation support to language spring + libraries spring-boot, spring-mvc, spring-cloud

for details see #4091

@cbornet
Copy link
Contributor

cbornet commented Jan 6, 2017

spring-cloud is a client lib. It should not be generated in samples/server

kevinoid and others added 4 commits January 7, 2017 21:56
* Fix Gson parsing of Joda DateTime without millis

The DateTimeFormatter returned by ISODateTimeFormat.dateTime() only
parses dates with millisecond values, and throws
IllegalArgumentException when milliseconds are not present.  The
date-time construct from RFC 3339 Section 5.6 referenced by the
Swagger/OpenAPI spec allows fractional second values to be omitted.
This results in valid date-time values being rejected by the generated
code.

This commit fixes the problem by using .dateOptionalTimeParser() for
parsing, which correctly handles date-time values without fractional
seconds.  A previous version of this commit used .dateTimeParser(),
which accepted a time without a date and was considered too liberal.
Note that .dateTime() must still be used for printing, which is not
supported by .dateTimeParser().

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>

* Fix akka-scala date-time parser with Joda

As in the previous commit, which fixed Java generators,
ISOISODateTimeFormat.dateOptionalTimeParser() should be used for
date-time parsing and ISOISODateTimeFormat.dateTime() for printing.
Apply the same change to akka-scala.

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
…4490)

* [swift3] allow POST with both body and query parameters

* Correctly support non-string and optional query parameters.
@jfiala
Copy link
Contributor Author

jfiala commented Jan 7, 2017

thx for the hint - removed server sample & updated client/spring-cloud.

fehguy and others added 16 commits January 7, 2017 17:08
…api#4480)

* Preliminary implementation for issue-4416

* Updated README.md with  reserved-words-mappings  parameter.
* Fixes for issue 4226. Detects and warns about more than one inline object; sets discriminator on CodegenModel; Adds templates to other Java languages
Changes to be committed:
	modified:   modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java
	modified:   modules/swagger-codegen/src/main/resources/Java/typeInfoAnnotation.mustache
	new file:   modules/swagger-codegen/src/main/resources/JavaInflector/typeInfoAnnotation.mustache
	new file:   modules/swagger-codegen/src/main/resources/JavaJaxRS/typeInfoAnnotation.mustache
	new file:   modules/swagger-codegen/src/main/resources/JavaSpring/typeInfoAnnotation.mustache

* Add vendor extension for x-discriminator-value
Changes to be committed:
	modified:   modules/swagger-codegen/src/main/resources/Java/typeInfoAnnotation.mustache
	modified:   modules/swagger-codegen/src/main/resources/JavaInflector/typeInfoAnnotation.mustache
	modified:   modules/swagger-codegen/src/main/resources/JavaJaxRS/typeInfoAnnotation.mustache
	modified:   modules/swagger-codegen/src/main/resources/JavaSpring/typeInfoAnnotation.mustache

* Add "visible = true" to @JsonTypeInfo jackson annotations for Java languages
Changes to be committed:
modified:   modules/swagger-codegen/src/main/resources/Java/typeInfoAnnotation.mustache
modified:   modules/swagger-codegen/src/main/resources/JavaInflector/typeInfoAnnotation.mustache
modified:   modules/swagger-codegen/src/main/resources/JavaJaxRS/typeInfoAnnotation.mustache
modified:   modules/swagger-codegen/src/main/resources/JavaSpring/typeInfoAnnotation.mustache
* add script to detect carriage return

* add check for generator as well

* add fail fast to travis config

* remove tab

* move scripts under bin/utils

* remove carriage return

* move scripts to bin/utils
…agger-api#4458)

* Fix for all capital field name

* Cosmetic: remove trailing spaces

* Adding ./bin/jaxrs-petstore-server.sh output.
…wagger-api#4532 (swagger-api#4534)

* Overriden objectmapper wasn't used in deserialisation

Use previously provided apiInvoker instead of creating a instance at deserialision stage

* update scala sample
…4525)

* Remove unnecessary call to setHost() in the constructor

The default host will be automatically set on the client by the ApiClient constructor.

* Updated PHP API Classes corresponding to template updates in swagger-api#4525.

* Additional changes generated by the petstore update unrelated to swagger-api#4525, but seem to have not been included yet.

* Add test to prevent regressions of swagger-api#4525
* Initial commit

* Remormatted petstore tests

* Added Bash codegen to main README.md

* Added bash to integration tests

* Fixed stdin detection in generated script

* Added back ruby module
jfiala and others added 12 commits January 19, 2017 15:13
…pi#4492)

* add beanvalidation to jaxrs and add support for outer Enums swagger-api#4091

* cleanup Codegen swagger-api#4091

* cleanup samples swagger-api#4091

* cleanup tabs

* updated samples to petstore.yaml (before petstore.json)

* add support for DecimalMin/DecimalMax/Min/Max swagger-api#4091

* add check for hideGenerationTimestamp swagger-api#4091

* replace tabs

* correct line endings to lf
…ttern (swagger-api#4439)

* Allows for generation of spring conroller code using the decorator pattern

* Change Decorator to Delegate in spring codegen
@wing328
Copy link
Contributor

wing328 commented Jan 19, 2017

@jfiala when you've time, would you please rebase on the latest master to resolve the merge conflicts?

wing328 and others added 9 commits January 19, 2017 21:44
* [maven-plugin] allow for ignore file override

The .swagger-codegen-ignore file is beneficial for existing source
directories to provide pattern-based exclusion rules for existing source
to be ignored by swagger codegen. Until now, there's been no utility
other than skipOverwrite to modify the initial generation of code
(either via CLI or maven plugin).

This commit adds support for an ignoreFileOverride option to both the
CLI and the maven plugin.

Example CLI usage:

```
java -jar swagger-codegen.jar generate \
    -i swagger.json -l csharp \
    -o target --ignore-file-override /path/to/ignore-file
```

Example Maven Plugin configuration:

```
    <build>
        <plugins>
            <plugin>
                <groupId>io.swagger</groupId>
                <artifactId>swagger-codegen-maven-plugin</artifactId>
                <version>2.2.2-SNAPSHOT</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <inputSpec>${project.basedir}/src/main/resources/swagger.yaml</inputSpec>
                            <language>csharp</language>
                            <invokerPackage>io.swagger</invokerPackage>
                            <modelPackage>io.swagger.models</modelPackage>
                            <apiPackage>io.swagger.apis</apiPackage>
                            <ignoreFileOverride>/Users/jim/projects/swagger-codegen/.sample-ignore</ignoreFileOverride>
                            <configOptions>
                            </configOptions>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
```

* [maven-plugin] update new javadocs

* fix bad merge due to missing }
…degen into spring_beanval

Conflicts:
	modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java
	modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SpringCodegen.java
	modules/swagger-codegen/src/main/resources/JavaSpring/apiController.mustache
	modules/swagger-codegen/src/test/java/io/swagger/codegen/options/SpringOptionsProvider.java
	modules/swagger-codegen/src/test/java/io/swagger/codegen/spring/SpringOptionsTest.java
	samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApi.java
	samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApiController.java
@jfiala
Copy link
Contributor Author

jfiala commented Jan 19, 2017

@wing328 I rebased and updated the samples for spring-boot and spring-cloud once more.

@jfiala
Copy link
Contributor Author

jfiala commented Jan 19, 2017

closing PR as it shows too many changes due to error during rebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.