2

So maybe I'm trying to go into too much detail in my descriptor, but here's my use case. While defining the schema of the object that is returned in the response body for my API, I have one property of the object the value of which is an object with variable properties, so I am using the additionalProperties descriptor.

{
  "type": "object",
  "additionalProperties": {
    "type": "string"
  }
}

However instead of describing the type of the values in this variable keyed object as string, I would like to describe them more precisely, seeing that the string is actually a pipe delimited serialization of an array. Example:

{
  "property1": {
    "variableProperty1": "info1|info2|info3",
    "variableProperty2": "info1|info2|info3"
  }
}

Is there any way of describing this pipe-delimited serialization? Something like:

{
  "type": "object",
  "additionalProperties": {
    "type": "array",
    "explode": false,
    "encoding": {
      "style": "pipeDelimited"
    }
  },
}

Or is this only possible for query parameters?

JohnRDOrazio
  • 1,358
  • 2
  • 15
  • 28
  • Does this answer your question -- [How to write OpenAPI 3 (Swagger) specification for property name in `map` object?](https://stackoverflow.com/q/46552863/113116) Or do you mean that that dictionary _values_ (not keys) are pipe-delimited strings? – Helen Aug 03 '20 at 06:58
  • 1
    no in fact I mean that dictionary *values* are pipe-delimited strings, see the middle example above – JohnRDOrazio Aug 03 '20 at 14:09

0 Answers0