Skip to content
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

Adds isShort + isUnboundedInteger to IJsonSchemaValidationProperties implementers #9519

Merged
merged 17 commits into from
May 26, 2021

Conversation

spacether
Copy link
Contributor

@spacether spacether commented May 19, 2021

Adds isShort + isUnboundedInteger to IJsonSchemaValidationProperties implementers
This allows CodegenModel CodegenResponse CodegenParameter CodegenResponse
to be able to tell the difference in the templates between an int32 parameter and an unbounded integer parameter
When merged, this will resolve
#9447 (comment)

This is not a breaking change with fallback because isInteger behaves the same.
If one needs to differentiate between int32 and unbounded integers, one should use the template variables:

  • isShort
  • isUnboundedInteger

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package 
    ./bin/generate-samples.sh
    ./bin/utils/export_docs_generators.sh
    
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    For Windows users, please run the script in Git BASH.
  • File the PR against the correct branch: master, 5.1.x, 6.0.x
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

@spacether spacether added this to the 5.2.0 milestone May 19, 2021
@spacether spacether linked an issue May 19, 2021 that may be closed by this pull request
@spacether spacether changed the title Adds isShortInteger to IJsonSchemaValidationProperties implementers Adds isShort to IJsonSchemaValidationProperties implementers May 23, 2021
@spacether
Copy link
Contributor Author

spacether commented May 23, 2021

Updating isInteger to mean unbounded integers and isShort to mean int32 resulted in the following 123 files changing:

	modified:   samples/client/petstore/R/R/model_api_response.R
	modified:   samples/client/petstore/R/R/order.R
	modified:   samples/client/petstore/R/R/user.R
	modified:   samples/client/petstore/bash/docs/FakeApi.md
	modified:   samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/docs/FakeApi.md
	modified:   samples/client/petstore/csharp-netcore/OpenAPIClient-net47/docs/FakeApi.md
	modified:   samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/docs/FakeApi.md
	modified:   samples/client/petstore/csharp-netcore/OpenAPIClient/docs/FakeApi.md
	modified:   samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/FakeApi.md
	modified:   samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md
	modified:   samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs
	modified:   samples/client/petstore/go/go-petstore/docs/FakeApi.md
	modified:   samples/client/petstore/java/google-api-client/docs/FakeApi.md
	modified:   samples/client/petstore/java/jersey1/docs/FakeApi.md
	modified:   samples/client/petstore/java/native-async/docs/FakeApi.md
	modified:   samples/client/petstore/java/native/docs/FakeApi.md
	modified:   samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/FakeApi.md
	modified:   samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/EnumTest.java
	modified:   samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeApi.md
	modified:   samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/EnumTest.java
	modified:   samples/client/petstore/java/okhttp-gson/docs/FakeApi.md
	modified:   samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/EnumTest.java
	modified:   samples/client/petstore/java/rest-assured-jackson/docs/FakeApi.md
	modified:   samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FormatTest.java
	modified:   samples/client/petstore/java/rest-assured/docs/FakeApi.md
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumTest.java
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FormatTest.java
	modified:   samples/client/petstore/java/resteasy/docs/FakeApi.md
	modified:   samples/client/petstore/java/resttemplate-withXml/docs/FakeApi.md
	modified:   samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumTest.java
	modified:   samples/client/petstore/java/resttemplate/docs/FakeApi.md
	modified:   samples/client/petstore/java/retrofit2-play26/docs/FakeApi.md
	modified:   samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FormatTest.java
	modified:   samples/client/petstore/java/retrofit2/docs/FakeApi.md
	modified:   samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumTest.java
	modified:   samples/client/petstore/java/retrofit2rx2/docs/FakeApi.md
	modified:   samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumTest.java
	modified:   samples/client/petstore/java/retrofit2rx3/docs/FakeApi.md
	modified:   samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumTest.java
	modified:   samples/client/petstore/java/vertx-no-nullable/docs/FakeApi.md
	modified:   samples/client/petstore/java/vertx/docs/FakeApi.md
	modified:   samples/client/petstore/java/webclient/docs/FakeApi.md
	modified:   samples/client/petstore/javascript-es6/docs/FakeApi.md
	modified:   samples/client/petstore/javascript-promise-es6/docs/FakeApi.md
	modified:   samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGModel.xcdatamodeld/SWGModel.xcdatamodel/contents
	modified:   samples/client/petstore/perl/docs/FakeApi.md
	modified:   samples/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md
	modified:   samples/client/petstore/python-asyncio/docs/FakeApi.md
	modified:   samples/client/petstore/python-legacy/docs/FakeApi.md
	modified:   samples/client/petstore/python-tornado/docs/FakeApi.md
	modified:   samples/client/petstore/ruby-faraday/docs/FakeApi.md
	modified:   samples/client/petstore/ruby/docs/FakeApi.md
	modified:   samples/client/petstore/swift5/alamofireLibrary/docs/FakeAPI.md
	modified:   samples/client/petstore/swift5/combineLibrary/docs/FakeAPI.md
	modified:   samples/client/petstore/swift5/default/docs/FakeAPI.md
	modified:   samples/client/petstore/swift5/nonPublicApi/docs/FakeAPI.md
	modified:   samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift
	modified:   samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift
	modified:   samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift
	modified:   samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift
	modified:   samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift
	modified:   samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift
	modified:   samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift
	modified:   samples/client/petstore/swift5/objcCompatible/docs/FakeAPI.md
	modified:   samples/client/petstore/swift5/promisekitLibrary/docs/FakeAPI.md
	modified:   samples/client/petstore/swift5/readonlyProperties/docs/FakeAPI.md
	modified:   samples/client/petstore/swift5/resultLibrary/docs/FakeAPI.md
	modified:   samples/client/petstore/swift5/rxswiftLibrary/docs/FakeAPI.md
	modified:   samples/client/petstore/swift5/urlsessionLibrary/docs/FakeAPI.md
	modified:   samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts
	modified:   samples/openapi3/client/elm/src/Api/Data.elm
	modified:   samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/doc/FakeApi.md
	modified:   samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/lib/src/model/enum_test.dart
	modified:   samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/doc/FakeApi.md
	modified:   samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/model/enum_test.dart
	modified:   samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/doc/FakeApi.md
	modified:   samples/openapi3/client/petstore/dart2/petstore_json_serializable_client_lib_fake/doc/FakeApi.md
	modified:   samples/openapi3/client/petstore/go/go-petstore/docs/FakeApi.md
	modified:   samples/openapi3/client/petstore/java/native/docs/FakeApi.md
	modified:   samples/openapi3/client/petstore/python-legacy/docs/FakeApi.md
	modified:   samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/FormatTest.java
	modified:   samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiController.java
	modified:   samples/server/petstore/java-undertow/src/main/java/org/openapitools/handler/PathHandlerInterface.java
	modified:   samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/EnumTest.java
	modified:   samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/FormatTest.java
	modified:   samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/FakeApi.java
	modified:   samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/FormatTest.java
	modified:   samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApi.java
	modified:   samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/FormatTest.java
	modified:   samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/FormatTest.java
	modified:   samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/FormatTest.java
	modified:   samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/FakeApi.java
	modified:   samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/FormatTest.java
	modified:   samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/FakeApi.java
	modified:   samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/FormatTest.java
	modified:   samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeApi.java
	modified:   samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/FormatTest.java
	modified:   samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/FakeApi.java
	modified:   samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/FormatTest.java
	modified:   samples/server/petstore/python-blueplanet/model-definitions/types/tosca/openapi_server/ApiResponse_ResourceType.tosca
	modified:   samples/server/petstore/python-blueplanet/model-definitions/types/tosca/openapi_server/Order_ResourceType.tosca
	modified:   samples/server/petstore/python-blueplanet/model-definitions/types/tosca/openapi_server/User_ResourceType.tosca
	modified:   samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/docs/fake_api.md
	modified:   samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/examples/client/main.rs
	modified:   samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/server/mod.rs
	modified:   samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FormatTest.java
	modified:   samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FormatTest.java
	modified:   samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/FormatTest.java
	modified:   samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java
	modified:   samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FormatTest.java
	modified:   samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java
	modified:   samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FormatTest.java
	modified:   samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FormatTest.java
	modified:   samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java
	modified:   samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java
	modified:   samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java
	modified:   samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FormatTest.java
	modified:   samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FormatTest.java
	modified:   samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FormatTest.java
	modified:   samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java
	modified:   samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java
	modified:   samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FormatTest.java
	modified:   samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTest.java

Fixing them is too much work for me to do in this PR.
So I will

  • revert the isInteger behavior to master branch behavior (unbounded int + int32 meaning)
  • add IsShort
  • add isUnboundedInteger
  • add tests of them

@spacether spacether changed the title Adds isShort to IJsonSchemaValidationProperties implementers Adds isShort + isUnboundedInteger to IJsonSchemaValidationProperties implementers May 24, 2021
@spacether
Copy link
Contributor Author

closing and re-opening to try to kick off bitrise

@spacether spacether closed this May 26, 2021
@spacether spacether reopened this May 26, 2021
@spacether
Copy link
Contributor Author

CircleCi error is unrelated

@spacether
Copy link
Contributor Author

closing and re-opening to try to travis to run.
Appveyor csharp-netcore errors look unrelated

@spacether spacether closed this May 26, 2021
@spacether spacether reopened this May 26, 2021
@spacether
Copy link
Contributor Author

Errors are unrelated to this PR

@spacether spacether merged commit 6e6b847 into OpenAPITools:master May 26, 2021
@spacether spacether deleted the adds_isShortInteger branch May 26, 2021 19:47
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.

[REQ] Add ability to differentiate between integer and int32 schemas
2 participants