- 
                Notifications
    
You must be signed in to change notification settings  - Fork 41
 
Open
Description
grape-swagger has support for additionalProperties for object-type parameters: https://github.com/ruby-grape/grape-swagger?tab=readme-ov-file#additional-properties
It would be really nice if grape-swagger-entity also supported this for object-type fields in entities.
expose :string_to_string, documentation: { type: "object", additional_properties: "string" }
# or `additional_properties: String`? Ideally both should be supported.
expose :string_to_entity, documentation: { type: "object", additional_properties: Entity }should translate to:
"string_to_string": {
  "type": "object",
  "additionalProperties": {
    "type": "string"
  }
},
"string_to_entity": {
  "type": "object",
  "additionalProperties": {
    "$ref": "#/definitions/Entity"
  }
},I took a brief stab at this, but handling the entity case proved tricky because I don't think grape-swagger-entity has access to the full definitions? I'm not very familiar with the code and I didn't try for very long so I might have missed something obvious.
numbata
Metadata
Metadata
Assignees
Labels
No labels