LiveRamp / reslang

A language for describing resource-oriented APIs & turning them into Swagger or resource diagrams. Oriented around the concepts we want to expose in the APIs.
Apache License 2.0
23 stars 7 forks source link

Put `format` attribute under the `items` attribute for array properties #42

Closed lmossman closed 4 years ago

lmossman commented 4 years ago

The Field API defines an fieldIDs array field for the bulk disable action. This generated swagger that looks like this:

        fieldIDs:
          description: IDs of Fields to disable.
          format: int64
          items:
            type: integer
            example: 'Link to Audience::Field resource(s) via id(s)'
          type: array

This is slightly incorrect, as the format: int64 line should be underneath the items attribute, as the int64 format applies to the integer items. The above swagger generates a Java class with fieldIDs as a list of Integers, rather than Longs as is desired.

This should be fixed by changing reslang to generate swagger that has the format underneath the items attribute for array properties. Here is what the correct swagger should look like:

        fieldIDs:
          description: IDs of Fields to disable.
          items:
            type: integer
            format: int64
            example: 'Link to Audience::Field resource(s) via id(s)'
          type: array
liveandrew commented 4 years ago

fixed in 9a5e520d7b3726de1de984c7f87c75b7419fefaf - v1.3.5