-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
[BUG] R generator throws: Cannot read field "isArray" because "codegenProperty" is null #15915
Comments
The OA Generator (v6.6.0) for R works when fed with the Pet Store API description. I can reproduce the error reported by doing the following modification to the Pet Store API description, where the commented code is replaced by ...
/pet/findByStatus:
get:
tags:
- pet
summary: Finds Pets by status
description: Multiple status values can be provided with comma separated strings
operationId: findPetsByStatus
parameters:
- name: status
in: query
description: Status values that need to be considered for filter
required: false
explode: true
schema:
$ref: '#/components/schemas/Customer'
# type: string
# enum:
# - available
# - pending
# - sold
# default: available
responses:
... Error: > nx run openchallenges-api-client-r:openapi-generate
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.DefaultGenerator - Generating with dryRun=false
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.DefaultGenerator - OpenAPI Generator: r (client)
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.DefaultGenerator - Generator 'r' is considered stable.
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.utils.URLPathUtils - 'host' (OAS 2.0) or 'servers' (OAS 3.0) not defined in the spec. Default to [http://localhost] for server URL [http://localhost/v3]
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.languages.RClientCodegen - ApiResponse (reserved word) cannot be used as model name. Renamed to ModelApiResponse
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.TemplateManager - writing file /workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/R/address.R
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.TemplateManager - writing file /workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/tests/testthat/test_address.R
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.TemplateManager - writing file /workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/docs/Address.md
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.TemplateManager - writing file /workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/R/category.R
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.TemplateManager - writing file /workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/tests/testthat/test_category.R
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.TemplateManager - writing file /workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/docs/Category.md
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.TemplateManager - writing file /workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/R/customer.R
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.TemplateManager - writing file /workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/tests/testthat/test_customer.R
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.TemplateManager - writing file /workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/docs/Customer.md
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.TemplateManager - writing file /workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/R/model_api_response.R
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.TemplateManager - writing file /workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/tests/testthat/test_model_api_response.R
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.TemplateManager - writing file /workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/docs/ModelApiResponse.md
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.TemplateManager - writing file /workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/R/order.R
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.TemplateManager - writing file /workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/tests/testthat/test_order.R
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.TemplateManager - writing file /workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/docs/Order.md
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.TemplateManager - writing file /workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/R/pet.R
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.TemplateManager - writing file /workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/tests/testthat/test_pet.R
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.TemplateManager - writing file /workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/docs/Pet.md
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.TemplateManager - writing file /workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/R/tag.R
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.TemplateManager - writing file /workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/tests/testthat/test_tag.R
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.TemplateManager - writing file /workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/docs/Tag.md
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.TemplateManager - writing file /workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/R/user.R
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.TemplateManager - writing file /workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/tests/testthat/test_user.R
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.TemplateManager - writing file /workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/docs/User.md
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/json)
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.DefaultCodegen - Multiple MediaTypes found, using only the first one
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/json)
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/json)
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/json)
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/json)
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/json)
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/json)
[[api-client-r] #{cwd}/petstore.yaml] Exception in thread "main" java.lang.RuntimeException: Could not generate api file for 'Pet'
[[api-client-r] #{cwd}/petstore.yaml] at org.openapitools.codegen.DefaultGenerator.generateApis(DefaultGenerator.java:717)
[[api-client-r] #{cwd}/petstore.yaml] at org.openapitools.codegen.DefaultGenerator.generate(DefaultGenerator.java:949)
[[api-client-r] #{cwd}/petstore.yaml] at org.openapitools.codegen.cmd.Generate.execute(Generate.java:487)
[[api-client-r] #{cwd}/petstore.yaml] at org.openapitools.codegen.cmd.OpenApiGeneratorCommand.run(OpenApiGeneratorCommand.java:32)
[[api-client-r] #{cwd}/petstore.yaml] at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:66)
[[api-client-r] #{cwd}/petstore.yaml] Caused by: java.lang.NullPointerException: Cannot read field "isArray" because "codegenProperty" is null
[[api-client-r] #{cwd}/petstore.yaml] at org.openapitools.codegen.languages.RClientCodegen.constructExampleCode(RClientCodegen.java:950)
[[api-client-r] #{cwd}/petstore.yaml] at org.openapitools.codegen.languages.RClientCodegen.constructExampleCode(RClientCodegen.java:932)
[[api-client-r] #{cwd}/petstore.yaml] at org.openapitools.codegen.languages.RClientCodegen.postProcessOperationsWithModels(RClientCodegen.java:903)
[[api-client-r] #{cwd}/petstore.yaml] at org.openapitools.codegen.DefaultGenerator.processOperations(DefaultGenerator.java:1271)
[[api-client-r] #{cwd}/petstore.yaml] at org.openapitools.codegen.DefaultGenerator.generateApis(DefaultGenerator.java:605)
[[api-client-r] #{cwd}/petstore.yaml] ... 4 more
[[api-client-r] #{cwd}/petstore.yaml] java -jar "/workspaces/sage-monorepo/node_modules/@openapitools/openapi-generator-cli/versions/6.6.0.jar" generate --input-spec="/workspaces/sage-monorepo/libs/openchallenges/api-client-r/petstore.yaml" --generator-name="r" --output="/workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/" --additional-properties="disallowAdditionalPropertiesIfNotPresent=false,library=httr" exited with code 1
[api-client-r] #{cwd}/petstore.yaml
java -jar "/workspaces/sage-monorepo/node_modules/@openapitools/openapi-generator-cli/versions/6.6.0.jar" generate --input-spec="/workspaces/sage-monorepo/libs/openchallenges/api-client-r/petstore.yaml" --generator-name="r" --output="/workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/" --additional-properties="disallowAdditionalPropertiesIfNotPresent=false,library=httr"
Code generation failed |
Follow on the above example, turning the Customer:
# properties:
# id:
# type: integer
# format: int64
# example: 100000
# username:
# type: string
# example: fehguy
# address:
# type: array
# items:
# $ref: '#/components/schemas/Address'
# xml:
# wrapped: true
# name: addresses
# xml:
# name: customer
type: string OA Generator output: > nx run openchallenges-api-client-r:openapi-generate
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.DefaultGenerator - Generating with dryRun=false
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.DefaultGenerator - OpenAPI Generator: r (client)
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.DefaultGenerator - Generator 'r' is considered stable.
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.utils.URLPathUtils - 'host' (OAS 2.0) or 'servers' (OAS 3.0) not defined in the spec. Default to [http://localhost] for server URL [http://localhost/v3]
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.languages.RClientCodegen - ApiResponse (reserved word) cannot be used as model name. Renamed to ModelApiResponse
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.DefaultGenerator - Model Customer not generated since it's a free-form object
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.TemplateManager - writing file /workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/R/address.R
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.TemplateManager - writing file /workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/tests/testthat/test_address.R
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.TemplateManager - writing file /workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/docs/Address.md
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.TemplateManager - writing file /workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/R/category.R
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.TemplateManager - writing file /workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/tests/testthat/test_category.R
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.TemplateManager - writing file /workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/docs/Category.md
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.TemplateManager - writing file /workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/R/model_api_response.R
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.TemplateManager - writing file /workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/tests/testthat/test_model_api_response.R
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.TemplateManager - writing file /workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/docs/ModelApiResponse.md
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.TemplateManager - writing file /workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/R/order.R
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.TemplateManager - writing file /workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/tests/testthat/test_order.R
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.TemplateManager - writing file /workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/docs/Order.md
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.TemplateManager - writing file /workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/R/pet.R
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.TemplateManager - writing file /workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/tests/testthat/test_pet.R
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.TemplateManager - writing file /workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/docs/Pet.md
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.TemplateManager - writing file /workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/R/tag.R
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.TemplateManager - writing file /workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/tests/testthat/test_tag.R
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.TemplateManager - writing file /workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/docs/Tag.md
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.TemplateManager - writing file /workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/R/user.R
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.TemplateManager - writing file /workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/tests/testthat/test_user.R
[[api-client-r] #{cwd}/petstore.yaml] [main] INFO o.o.codegen.TemplateManager - writing file /workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/docs/User.md
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/json)
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.DefaultCodegen - Multiple MediaTypes found, using only the first one
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/json)
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/json)
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/json)
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/json)
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/json)
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[[api-client-r] #{cwd}/petstore.yaml] [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/json)
[[api-client-r] #{cwd}/petstore.yaml] Exception in thread "main" java.lang.RuntimeException: Could not generate api file for 'Pet'
[[api-client-r] #{cwd}/petstore.yaml] at org.openapitools.codegen.DefaultGenerator.generateApis(DefaultGenerator.java:717)
[[api-client-r] #{cwd}/petstore.yaml] at org.openapitools.codegen.DefaultGenerator.generate(DefaultGenerator.java:949)
[[api-client-r] #{cwd}/petstore.yaml] at org.openapitools.codegen.cmd.Generate.execute(Generate.java:487)
[[api-client-r] #{cwd}/petstore.yaml] at org.openapitools.codegen.cmd.OpenApiGeneratorCommand.run(OpenApiGeneratorCommand.java:32)
[[api-client-r] #{cwd}/petstore.yaml] at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:66)
[[api-client-r] #{cwd}/petstore.yaml] Caused by: java.lang.NullPointerException: Cannot read field "isArray" because "codegenProperty" is null
[[api-client-r] #{cwd}/petstore.yaml] at org.openapitools.codegen.languages.RClientCodegen.constructExampleCode(RClientCodegen.java:950)
[[api-client-r] #{cwd}/petstore.yaml] at org.openapitools.codegen.languages.RClientCodegen.constructExampleCode(RClientCodegen.java:932)
[[api-client-r] #{cwd}/petstore.yaml] at org.openapitools.codegen.languages.RClientCodegen.postProcessOperationsWithModels(RClientCodegen.java:903)
[[api-client-r] #{cwd}/petstore.yaml] at org.openapitools.codegen.DefaultGenerator.processOperations(DefaultGenerator.java:1271)
[[api-client-r] #{cwd}/petstore.yaml] at org.openapitools.codegen.DefaultGenerator.generateApis(DefaultGenerator.java:605)
[[api-client-r] #{cwd}/petstore.yaml] ... 4 more
[[api-client-r] #{cwd}/petstore.yaml] java -jar "/workspaces/sage-monorepo/node_modules/@openapitools/openapi-generator-cli/versions/6.6.0.jar" generate --input-spec="/workspaces/sage-monorepo/libs/openchallenges/api-client-r/petstore.yaml" --generator-name="r" --output="/workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/" --additional-properties="disallowAdditionalPropertiesIfNotPresent=false,library=httr" exited with code 1
[api-client-r] #{cwd}/petstore.yaml
java -jar "/workspaces/sage-monorepo/node_modules/@openapitools/openapi-generator-cli/versions/6.6.0.jar" generate --input-spec="/workspaces/sage-monorepo/libs/openchallenges/api-client-r/petstore.yaml" --generator-name="r" --output="/workspaces/sage-monorepo/libs/openchallenges/api-client-r/src/lib/" --additional-properties="disallowAdditionalPropertiesIfNotPresent=false,library=httr"
Code generation failed The error is triggerd by the |
The OA Spec 3.0 says:
The Pet Store example does not include an example of query parameter that has @wing328 I'm wondering whether what I'm experiencing is a bug or an unsupported feature even after looking at the page Documentation for the r Generator. |
fixed via #15953 please give it a try with the latest master (URL to snapshot version is in the readme) |
@wing328 My setup consists in the config file {
"$schema": "../../../node_modules/@openapitools/openapi-generator-cli/config.schema.json",
"spaces": 2,
"generator-cli": {
"version": "6.6.0",
"generators": {
"api-client-r": {
"generatorName": "r",
"inputSpec": "#{cwd}/../api-description/build/openapi.yaml",
"output": "#{cwd}/src/lib/",
"additionalProperties": {
"disallowAdditionalPropertiesIfNotPresent": false,
"library": "httr"
}
}
}
}
}
What I tried to use the snapshot version:
What is the recommended way to try the snapshot version in this context? |
Bug Report Checklist
package lombok does not exist
)Description
I want to generate an API client for R from this OpenAPI description, but the generation fails with the following error:
The generator configuration is available here.
openapi-generator version
6.6.0
OpenAPI declaration file content or url
openapi.yaml
Generation Details
See above for the command used, the generator config file and openapi file.
Steps to reproduce
openapi-generator-cli
(see the README of this repo)api-client-r
api-client-r
, generate the API client for R withopenapi-generator-cli generate
Related issues/PRs
Suggest a fix
The text was updated successfully, but these errors were encountered: