-
-
Notifications
You must be signed in to change notification settings - Fork 486
Open
Description
I have this schema:
- name: properties
in: query
description: Filter animals by properties
required: false
style: deepObject
schema:
type: object
additionalProperties: true
it generates this type:
Properties *map[string]interface{} `json:"properties,omitempty"`
Which is good and basically what i want, but the request validation fails for this url:
animals?properties[vaccinated]=true&properties[color]=black&properties[coat_length]=large
i get error: Invalid format for parameter properties: error assigning value to destination: error binding map: unhandled type: interface {}
If i say:
additionalProperties:
type: string
Then it works but the type is *map[string]string and i would manually have to go through jsonschema and loop over properties and convert types from string to bool or whatever. Is there a way to make it work with basically any object, or somehow skip validation for only that specific param?
Metadata
Metadata
Assignees
Labels
No labels