Uploaded image for project: 'Red Hat Build of Apache Camel for Quarkus'
  1. Red Hat Build of Apache Camel for Quarkus
  2. CEQ-11743

OpenAPI codegen bean validation fails if min/max is set to greater than Integer.MAX_VALUE with format int64

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • 3.Next.GA
    • 3.20.0.GA
    • None
    • None
    • False
    • Hide

      None

      Show
      None
    • False
    • Important
    • 0

      The POJOs generated with OpenAPI contract fails validation.

      Steps to reproduce:

      • Enable bean validation in application.properties:
        quarkus.camel.openapi.codegen.use-bean-validation=true
      • Add min/max to any of the properties in the schema:
       "components": {
      		"schemas": {
      			"Order": {
      				"type": "object",
      				"properties": {
      					"id": {
      						"type": "integer",
      						"format": "int64",
                                                       "minimum": 0,
                                                       "maximum": 787878787878,
      						 "example": 787878787878
      					}
      
      • Now, the project fails compilation:
      [ERROR] COMPILATION ERROR : 
      [INFO] -------------------------------------------------------------
      [ERROR] /test/api/src/main/java/io/swagger/client/api/StoreApi.java:[667,68] integer number too large
      [ERROR] /test/api/src/main/java/io/swagger/client/model/Order.java:[109,15] integer number too large
      [INFO] 2 errors 
      [INFO] -------------------------------------------------------------
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      

      Upstream Issue:

      https://github.com/swagger-api/swagger-codegen-generators/issues/1370

              Unassigned Unassigned
              rhn-support-adongre Avinash Dongre
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: