connectors icon indicating copy to clipboard operation
connectors copied to clipboard

Unable to parse integers found in enums in unqork open api spec

Open upgradingdave opened this issue 10 months ago • 0 comments

Describe the Bug

When trying to parse Unqork's open api spec, the following error is thrown:

Generation failed: class java.lang.Integer cannot be cast to class java.lang.String (java.lang.Integer and java.lang.String are in module java.base of loader 'bootstrap')

Steps to Reproduce

  1. Run this:
congen -e ServiceTask -e IntermediateThrowEvent generate openapi-outbound https://developers.unqork.io/api/1.0/openapi.yml
  1. An exception is thrown because the choice variables refrenced on this line here are expected to be Strings. However, in Unqork open api spec, line 5709 has a definition like this:
    SubmissionSortOrder:
      name: sortOrder
      in: query
      description: Order of sort, if `sortBy` is specified.  One of [`1` (ascending),`-1` (descending)]
      required: false
      schema:
        type: integer
        enum:
          - 1
          - -1
        default: 1

The 1 and -1 are Integers and that's what causes the type cast exception

Expected Behavior

No error should be thrown and a valid json element template to be output.

Environment

  • OS: MacOS Monterey (12.6.3)
  • Library version: 8.5.0-SNAPSHOT
  • Camunda version: N/A

upgradingdave avatar Mar 29 '24 00:03 upgradingdave