1

I have an API that includes an array of hashes as a parameter:

param :parties, Array, :required => true, :desc => "A set of parties", of: Hash do
      param :role, String, :required => true
      param :guid, String, :required => true
      param :first_name, :required => false
      param :last_name, :required => false
end

However, if I use rake apipie:static_swagger_json using APIPIE 0.5.19 on Ruby 3.0.3 to create an OpenAPI 2.0 compatible schema it gets translated to

"parties": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "A set of parties"
                },

Am I doing something wrong or is the SwaggerGenerator bundled with Apipie not able to produce a schema for arrays of objects/hashes ?

patschiboy
  • 1,091
  • 8
  • 21

1 Answers1

0

Not pretty, but this did what I needed: https://gist.github.com/patsch/0482a8db40b091d82be311baa47db3f1

patschiboy
  • 1,091
  • 8
  • 21