-
Notifications
You must be signed in to change notification settings - Fork 6k
[Spring] Add beanvalidation annotations #4510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
|
spring-cloud is a client lib. It should not be generated in samples/server |
* 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.
Contributor
Author
|
thx for the hint - removed server sample & updated client/spring-cloud. |
updated version
…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
…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
…gger-codegen into jfiala-jaxrs_jersey_beanval2
* add beanvalidation to jaxrs-resteasy swagger-api#4091 * replace tabs
…ttern (swagger-api#4439) * Allows for generation of spring conroller code using the decorator pattern * Change Decorator to Delegate in spring codegen
Contributor
|
@jfiala when you've time, would you please rebase on the latest master to resolve the merge conflicts? |
* [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
Contributor
Author
|
@wing328 I rebased and updated the samples for spring-boot and spring-cloud once more. |
Contributor
Author
|
closing PR as it shows too many changes due to error during rebase. |
This was referenced Jan 19, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR checklist
./bin/to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.shand./bin/security/{LANG}-petstore.shif updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates)2.3.0branch 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