Update a schema
PUT https://api.getpostman.com/apis/{{apiId}}/versions/{{apiVersionId}}/schemas/{{schemaId}}
Updates a schema. The request body must contain a schema object with the following properties:
-
type— A string value that contains the schema's type. One of:-
openapi3_1 -
openapi3 -
openapi2 -
openapi1 -
raml -
raml1 -
wsdl1 -
wsdl2 -
graphql -
proto2 -
graphql -
proto3
-
-
language— A string value that contains the schema's language. One of:- OpenAPI and RAML —
jsonoryaml - GraphQL —
graphql - WSDL —
xml - Protobuf —
proto
- OpenAPI and RAML —
-
schema— Optional. A string value that contains the schema's contents.
Requires an API Key as the
X-Api-Keyrequest header or anapikeyURL query parameter.
Request Body
{"schema"=>{"language"=>"yaml", "schema"=>"openapi: 3.0.0\ninfo:\n version: v1.0\n title: API\nservers:\n - url: http://localhost:3000\npaths:\n /user:\n get:\n summary: Returns details about a particular user\n operationId: listUser\n tags:\n - user\n parameters:\n - name: id\n in: query\n description: ID of the user\n required: true\n schema:\n type: integer\n format: int32\n responses:\n '200':\n description: Details about a user by ID\n headers:\n x-next:\n description: A link to the next page of responses\n schema:\n type: string\n content:\n application/json:\n schema:\n $ref: '#/components/schemas/User'\n default:\n description: Unexpected error\n content:\n application/json:\n schema:\n $ref: '#/components/schemas/Error'\ncomponents:\n schemas:\n User:\n type: object\n required:\n - id\n - name\n properties:\n id:\n type: integer\n format: int64\n name:\n type: string\n tag:\n type: string\n Error:\n type: object\n required:\n - code\n - message\n properties:\n code:\n type: integer\n format: int32\n message:\n type: string\n", "type"=>"openapi3"}}
HEADERS
| Key | Datatype | Required | Description |
|---|---|---|---|
Content-Type | string |
RESPONSES
status: OK
{"schema":{"id":"e3b3a0b7-34d5-4fc5-83e0-118bd9e8c822","language":"yaml","apiVersion":"ad810c39-df60-434e-a76f-a2192cd8d81f","type":"openapi3","createdBy":"1234567890","updatedBy":"1234567890","createdAt":"2021-05-22T13:17:07.000Z","updatedAt":"2021-05-22T13:17:07.000Z"}}