OpenAPI: what schema to accept any (complex) JSON value

前端 未结 2 601
执念已碎
执念已碎 2020-11-28 16:43

The API for which I\'m writing a Swagger 2.0 specification is basically a store for any JSON value.

I want a path to read value and a path to store any JSON values (

2条回答
  •  醉酒成梦
    2020-11-28 17:11

    Maybe this is what your are looking for "Patterned Objects":

    Field Pattern: ^x-

    Type: Any

    Description: Allows extensions to the Swagger Schema. The field name MUST begin with x-, for example, x-internal-id. The value can be null, a primitive, an array or an object. See Vendor Extensions for further details.

    Source: https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md

提交回复
热议问题