New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More ā†’
Socket
Sign inDemoInstall
Socket

@readme/oas-examples

Package Overview
Dependencies
Maintainers
10
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@readme/oas-examples - npm Package Compare versions

Comparing version 4.5.0 to 5.0.0

2.0/json/schema-circular.json

285

2.0/json/petstore-simple.json

@@ -6,13 +6,16 @@ {

"title": "Swagger Petstore",
"description": "A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification",
"termsOfService": "http://swagger.io/terms/",
"contact": {
"name": "Swagger API Team"
},
"license": {
"name": "MIT"
}
"description": "This is a slimmed down single path version of the Petstore definition."
},
"host": "petstore.swagger.io",
"basePath": "/api",
"basePath": "/v2",
"tags": [
{
"name": "pet",
"description": "Everything about your Pets",
"externalDocs": {
"description": "Find out more",
"url": "http://swagger.io"
}
}
],
"schemes": ["http"],

@@ -22,26 +25,17 @@ "consumes": ["application/json"],

"paths": {
"/pets": {
"/pet/{petId}": {
"get": {
"description": "Returns all pets from the system that the user has access to",
"operationId": "findPets",
"produces": ["application/json", "application/xml", "text/xml", "text/html"],
"tags": ["pet"],
"summary": "Find pet by ID",
"description": "Returns a single pet",
"operationId": "getPetById",
"produces": ["application/xml", "application/json"],
"parameters": [
{
"name": "tags",
"in": "query",
"description": "tags to filter by",
"required": false,
"type": "array",
"items": {
"type": "string"
},
"collectionFormat": "csv"
},
{
"name": "limit",
"in": "query",
"description": "maximum number of results to return",
"required": false,
"name": "petId",
"in": "path",
"description": "ID of pet to return",
"required": true,
"type": "integer",
"format": "int32"
"format": "int64"
}

@@ -51,87 +45,79 @@ ],

"200": {
"description": "pet response",
"description": "successful operation",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Pet"
}
"$ref": "#/definitions/Pet"
}
},
"default": {
"description": "unexpected error",
"schema": {
"$ref": "#/definitions/ErrorModel"
}
"400": {
"description": "Invalid ID supplied"
},
"404": {
"description": "Pet not found"
}
}
},
"security": [
{
"api_key": []
}
]
},
"post": {
"description": "Creates a new pet in the store. Duplicates are allowed",
"operationId": "addPet",
"produces": ["application/json"],
"tags": ["pet"],
"summary": "Updates a pet in the store with form data",
"description": "",
"operationId": "updatePetWithForm",
"consumes": ["application/x-www-form-urlencoded"],
"produces": ["application/xml", "application/json"],
"parameters": [
{
"name": "pet",
"in": "body",
"description": "Pet to add to the store",
"required": true,
"schema": {
"$ref": "#/definitions/NewPet"
}
}
],
"responses": {
"200": {
"description": "pet response",
"schema": {
"$ref": "#/definitions/Pet"
}
},
"default": {
"description": "unexpected error",
"schema": {
"$ref": "#/definitions/ErrorModel"
}
}
}
}
},
"/pets/{id}": {
"get": {
"description": "Returns a user based on a single ID, if the user does not have access to the pet",
"operationId": "findPetById",
"produces": ["application/json", "application/xml", "text/xml", "text/html"],
"parameters": [
{
"name": "id",
"name": "petId",
"in": "path",
"description": "ID of pet to fetch",
"description": "ID of pet that needs to be updated",
"required": true,
"type": "integer",
"format": "int64"
},
{
"name": "name",
"in": "formData",
"description": "Updated name of the pet",
"required": false,
"type": "string"
},
{
"name": "status",
"in": "formData",
"description": "Updated status of the pet",
"required": false,
"type": "string"
}
],
"responses": {
"200": {
"description": "pet response",
"schema": {
"$ref": "#/definitions/Pet"
}
},
"default": {
"description": "unexpected error",
"schema": {
"$ref": "#/definitions/ErrorModel"
}
"405": {
"description": "Invalid input"
}
}
},
"security": [
{
"petstore_auth": ["write:pets", "read:pets"]
}
]
},
"delete": {
"description": "deletes a single pet based on the ID supplied",
"tags": ["pet"],
"summary": "Deletes a pet",
"description": "",
"operationId": "deletePet",
"produces": ["application/xml", "application/json"],
"parameters": [
{
"name": "id",
"name": "api_key",
"in": "header",
"required": false,
"type": "string"
},
{
"name": "petId",
"in": "path",
"description": "ID of pet to delete",
"description": "Pet id to delete",
"required": true,

@@ -143,56 +129,107 @@ "type": "integer",

"responses": {
"204": {
"description": "pet deleted"
"400": {
"description": "Invalid ID supplied"
},
"default": {
"description": "unexpected error",
"schema": {
"$ref": "#/definitions/ErrorModel"
}
"404": {
"description": "Pet not found"
}
}
},
"security": [
{
"petstore_auth": ["write:pets", "read:pets"]
}
]
}
}
},
"securityDefinitions": {
"petstore_auth": {
"type": "oauth2",
"authorizationUrl": "http://petstore.swagger.io/oauth/dialog",
"flow": "implicit",
"scopes": {
"write:pets": "modify pets in your account",
"read:pets": "read your pets"
}
},
"api_key": {
"type": "apiKey",
"name": "api_key",
"in": "header"
}
},
"definitions": {
"Pet": {
"Category": {
"type": "object",
"allOf": [
{
"$ref": "#/definitions/NewPet"
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
{
"required": ["id"],
"properties": {
"id": {
"type": "integer",
"format": "int64"
}
}
"name": {
"type": "string"
}
]
},
"xml": {
"name": "Category"
}
},
"NewPet": {
"Tag": {
"type": "object",
"required": ["name"],
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"name": {
"type": "string"
},
"tag": {
"type": "string"
}
},
"xml": {
"name": "Tag"
}
},
"ErrorModel": {
"Pet": {
"type": "object",
"required": ["code", "message"],
"required": ["name", "photoUrls"],
"properties": {
"code": {
"id": {
"type": "integer",
"format": "int32"
"format": "int64"
},
"message": {
"type": "string"
"category": {
"$ref": "#/definitions/Category"
},
"name": {
"type": "string",
"example": "doggie"
},
"photoUrls": {
"type": "array",
"xml": {
"name": "photoUrl",
"wrapped": true
},
"items": {
"type": "string"
}
},
"tags": {
"type": "array",
"xml": {
"name": "tag",
"wrapped": true
},
"items": {
"$ref": "#/definitions/Tag"
}
},
"status": {
"type": "string",
"description": "pet status in the store",
"enum": ["available", "pending", "sold"]
}
},
"xml": {
"name": "Pet"
}

@@ -199,0 +236,0 @@ }

@@ -759,2 +759,17 @@ {

},
"Category": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"name": {
"type": "string"
}
},
"xml": {
"name": "Category"
}
},
"User": {

@@ -795,17 +810,2 @@ "type": "object",

},
"Category": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"name": {
"type": "string"
}
},
"xml": {
"name": "Category"
}
},
"Tag": {

@@ -812,0 +812,0 @@ "type": "object",

{
"openapi": "3.0.0",
"openapi": "3.0.3",
"info": {

@@ -14,3 +14,3 @@ "version": "1.0.0",

"paths": {
"/and": {
"/anything/and": {
"post": {

@@ -32,3 +32,3 @@ "summary": "Multiple forms of auth are required (&&)",

},
"/or": {
"/anything/or": {
"post": {

@@ -51,3 +51,3 @@ "summary": "Two forms of auth can be used, only one is required (||)",

},
"/and-or": {
"/anything/and-or": {
"post": {

@@ -71,3 +71,3 @@ "summary": "Two security flows are present, one of which has multiple forms of required auth (&& ||)",

},
"/many-and-or": {
"/anything/many-and-or": {
"post": {

@@ -110,4 +110,4 @@ "summary": "Many security flows are present, each with multiple forms of required auth (&& ||)",

"in": "cookie",
"name": "X-API-KEY (Cookie)",
"description": "An API key that will be supplied in a named cookie. https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.1.0.md#security-scheme-object"
"name": "api_key",
"description": "An API key that will be supplied in a named cookie. https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#security-scheme-object"
},

@@ -117,4 +117,4 @@ "apiKey_header": {

"in": "header",
"name": "X-API-KEY (Header)",
"description": "An API key that will be supplied in a named header. https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.1.0.md#security-scheme-object"
"name": "X-API-KEY",
"description": "An API key that will be supplied in a named header. https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#security-scheme-objec"
},

@@ -124,4 +124,4 @@ "apiKey_query": {

"in": "query",
"name": "X-API-KEY (Query)",
"description": "An API key that will be supplied in a named query parameter. https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.1.0.md#security-scheme-object"
"name": "apiKey",
"description": "An API key that will be supplied in a named query parameter. https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#security-scheme-objec"
},

@@ -131,3 +131,3 @@ "basic": {

"scheme": "basic",
"description": "Basic auth that takes a base64'd combination of `user:password`. https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.1.0.md#basic-authentication-sample"
"description": "Basic auth that takes a base64'd combination of `user:password`. https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#basic-authentication-sample"
},

@@ -137,3 +137,3 @@ "bearer": {

"scheme": "bearer",
"description": "A bearer token that will be supplied within an `Authentication` header as `bearer <token>`. https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.1.0.md#basic-authentication-sample"
"description": "A bearer token that will be supplied within an `Authentication` header as `bearer <token>`. https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#basic-authentication-sample"
},

@@ -144,7 +144,7 @@ "bearer_jwt": {

"bearerFormat": "JWT",
"description": "A special kind of bearer token that will be supplied within an `Authentication` header as `<bearerFormat> <token>` (and in this case `jwt <token>`). https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.1.0.md#jwt-bearer-sample"
"description": "A special kind of bearer token that will be supplied within an `Authentication` header as `<bearerFormat> <token>` (and in this case `jwt <token>`). https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#jwt-bearer-sample"
},
"oauth2": {
"type": "oauth2",
"description": "An OAuth 2 security flow. https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.1.0.md#fixed-fields-23",
"description": "An OAuth 2 security flow. https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#fixed-fields-23",
"flows": {

@@ -161,3 +161,3 @@ "implicit": {

"type": "oauth2",
"description": "An alternate OAuth 2 security flow. Functions identially to the other `oauth2` scheme, just with alternate URLs to authenticate against. https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.1.0.md#fixed-fields-23",
"description": "An alternate OAuth 2 security flow. Functions identially to the other `oauth2` scheme, just with alternate URLs to authenticate against. https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#fixed-fields-23",
"flows": {

@@ -164,0 +164,0 @@ "implicit": {

@@ -13,6 +13,25 @@ {

],
"tags": [
{
"name": "API Key"
},
{
"name": "HTTP"
},
{
"name": "OAuth 2"
},
{
"name": "OpenID Connect"
},
{
"name": "Other"
}
],
"paths": {
"/apiKey": {
"/anything/apiKey": {
"get": {
"summary": "`apiKey` auth supplied as query param",
"summary": "Query parameter",
"description": "`apiKey` auth will be supplied within an `apiKey` query parameter.",
"tags": ["API Key"],
"responses": {

@@ -30,3 +49,5 @@ "200": {

"post": {
"summary": "`apiKey` auth supplied in cookie",
"summary": "Cookie",
"description": "`apiKey` auth will be supplied within an `api_key` cookie.",
"tags": ["API Key"],
"responses": {

@@ -44,3 +65,5 @@ "200": {

"put": {
"summary": "`apiKey` auth supplied in header",
"summary": "Header",
"description": "`apiKey` auth will be supplied within an `X-API-KEY` header.",
"tags": ["API Key"],
"responses": {

@@ -58,5 +81,7 @@ "200": {

},
"/basic": {
"/anything/basic": {
"post": {
"summary": "`basic` auth",
"summary": "Basic",
"description": "Authentication credentials will be supplied within a `Basic` `Authorization` header.\n\nhttps://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#basic-authentication-sample",
"tags": ["HTTP"],
"responses": {

@@ -74,5 +99,7 @@ "200": {

},
"/bearer": {
"/anything/bearer": {
"post": {
"summary": "`bearer` auth",
"summary": "Bearer",
"description": "Authentication credentials will be supplied within a `Bearer` `Authorization` header.\n\nhttps://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#basic-authentication-sample",
"tags": ["HTTP"],
"responses": {

@@ -90,3 +117,5 @@ "200": {

"put": {
"summary": "`bearer` auth with a `jwt` format",
"summary": "Bearer (`jwt` format)",
"description": "Authentication credentials will be supplied within a `Bearer` `Authorization` header, but its data should be controlled as a JWT.\n\nhttps://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#basic-authentication-sample\n\n> ā„¹ļø\n> We currently do not support any special handling for this so they're handled as a standard `Bearer` authentication token.",
"tags": ["HTTP"],
"responses": {

@@ -104,5 +133,7 @@ "200": {

},
"/oauth2": {
"/anything/oauth2": {
"post": {
"summary": "`oauth2` auth",
"summary": "General support",
"description": "> ā„¹ļø\n> We currently do not handle OAuth 2 authentication flows so if an operation has an `oauth2` requirement we assume that the user, or the projects JWT, has a qualified `bearer` token and will use that.\n\nhttps://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#fixed-fields-23",
"tags": ["OAuth 2"],
"responses": {

@@ -120,6 +151,7 @@ "200": {

},
"/openIdConnect": {
"/anything/openIdConnect": {
"post": {
"summary": "`openIdConnect` auth",
"summary": "General support",
"description": "šŸš§ This is not supported.",
"tags": ["OpenID Connect"],
"responses": {

@@ -137,5 +169,7 @@ "200": {

},
"/no-auth": {
"/anything/no-auth": {
"post": {
"summary": "No auth requirements",
"description": "This operation does not have any authentication requirements.",
"tags": ["Other"],
"responses": {

@@ -148,5 +182,25 @@ "200": {

},
"/anything/optional-auth": {
"get": {
"summary": "Optional auth",
"description": "The `apiKey` query parameter auth on this operation is optional.\n\nhttps://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#security-requirement-object",
"tags": ["Other"],
"responses": {
"200": {
"description": "OK"
}
},
"security": [
{
"apiKey_query": []
},
{}
]
}
},
"/status/401": {
"post": {
"summary": "Auth required but all auth tokens will fail",
"summary": "Forced invalid authentication",
"description": "This endpoint requires an authentication header but making any request to it will forcefully return a 401 status code for invalid auth.",
"tags": ["Other"],
"responses": {

@@ -171,3 +225,3 @@ "401": {

"name": "api_key",
"description": "An API key that will be supplied in a named cookie. https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.1.0.md#security-scheme-object"
"description": "An API key that will be supplied in a named cookie. https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#security-scheme-object"
},

@@ -178,3 +232,3 @@ "apiKey_header": {

"name": "X-API-KEY",
"description": "An API key that will be supplied in a named header. https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.1.0.md#security-scheme-object"
"description": "An API key that will be supplied in a named header. https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#security-scheme-object"
},

@@ -185,3 +239,3 @@ "apiKey_query": {

"name": "apiKey",
"description": "An API key that will be supplied in a named query parameter. https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.1.0.md#security-scheme-object"
"description": "An API key that will be supplied in a named query parameter. https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#security-scheme-object"
},

@@ -191,3 +245,3 @@ "basic": {

"scheme": "basic",
"description": "Basic auth that takes a base64'd combination of `user:password`. https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.1.0.md#basic-authentication-sample"
"description": "Basic auth that takes a base64'd combination of `user:password`. https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#basic-authentication-sample"
},

@@ -197,3 +251,3 @@ "bearer": {

"scheme": "bearer",
"description": "A bearer token that will be supplied within an `Authentication` header as `bearer <token>`. https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.1.0.md#basic-authentication-sample"
"description": "A bearer token that will be supplied within an `Authentication` header as `bearer <token>`. https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#basic-authentication-sample"
},

@@ -204,7 +258,7 @@ "bearer_jwt": {

"bearerFormat": "JWT",
"description": "A bearer token that will be supplied within an `Authentication` header as `bearer <token>`. In this case, the format of the token is specified as JWT. https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.1.0.md#jwt-bearer-sample"
"description": "A bearer token that will be supplied within an `Authentication` header as `bearer <token>`. In this case, the format of the token is specified as JWT. https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#jwt-bearer-sample"
},
"oauth2": {
"type": "oauth2",
"description": "An OAuth 2 security flow. https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.1.0.md#fixed-fields-23",
"description": "An OAuth 2 security flow. https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#fixed-fields-23",
"flows": {

@@ -219,6 +273,18 @@ "implicit": {

},
"oauth2_alternate": {
"type": "oauth2",
"description": "An alternate OAuth 2 security flow. Functions identially to the other `oauth2` scheme, just with alternate URLs to authenticate against. https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#fixed-fields-23",
"flows": {
"implicit": {
"authorizationUrl": "http://alt.example.com/oauth/dialog",
"scopes": {
"write:things": "Add things to your account"
}
}
}
},
"openIdConnect": {
"type": "openIdConnect",
"openIdConnectUrl": "https://example.com/.well-known/openid-configuration",
"description": "OpenAPI authentication. https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.1.0.md#fixed-fields-23"
"description": "OpenAPI authentication. https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#fixed-fields-23"
}

@@ -225,0 +291,0 @@ }

@@ -30,3 +30,3 @@ {

"basePath": {
"default": "v2"
"default": "v1"
}

@@ -36,6 +36,14 @@ }

{
"url": "http://{subdomain}.local/{subdomain}",
"url": "https://{name}.readme.io:{port}/{basePath}",
"variables": {
"subdomain": {
"name": {
"default": "demo"
},
"port": {
"default": "3000",
"enum": ["3000", "5000"]
},
"basePath": {
"description": "path description",
"default": "v1"
}

@@ -46,34 +54,5 @@ }

"paths": {
"/create/{id}": {
"/endpoint": {
"post": {
"summary": "Should fetch variables from defaults and user values",
"operationId": "create",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "integer"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"properties": {
"foo": {
"type": "string"
}
},
"required": [
"foo"
]
}
}
}
},
"responses": {

@@ -80,0 +59,0 @@ "200": {

@@ -101,3 +101,3 @@ {

"in": "cookie",
"description": "A `form` style, non-exploded array.\n\n> It's unclear whether this encoding is the correct behavior because the `Cookie` header deviates from all other headers.",
"description": "A `form` style, non-exploded array.\n\n> On ReadMe we encode this kind of parameter within [@readme/httpsnippet](https://npm.im/@readme/httpsnippet) but it's unclear whether this encoding is the correct behavior because the `Cookie` header deviates from all other headers.",
"style": "form",

@@ -115,3 +115,3 @@ "explode": false,

"in": "cookie",
"description": "A `form` style, non-exploded object\n\n> It's unclear whether this encoding is the correct behavior because the `Cookie` header deviates from all other headers.",
"description": "A `form` style, non-exploded object\n\n> On ReadMe we encode this kind of parameter within [@readme/httpsnippet](https://npm.im/@readme/httpsnippet) but it's unclear whether this encoding is the correct behavior because the `Cookie` header deviates from all other headers.",
"style": "form",

@@ -154,3 +154,3 @@ "explode": false,

"in": "cookie",
"description": "A `form` style, exploded array.\n\n> It's unclear whether this encoding is the correct behavior because the `Cookie` header deviates from all other headers.",
"description": "A `form` style, exploded array.\n\n> On ReadMe we encode this kind of parameter within [@readme/httpsnippet](https://npm.im/@readme/httpsnippet) but it's unclear whether this encoding is the correct behavior because the `Cookie` header deviates from all other headers.",
"style": "form",

@@ -168,3 +168,3 @@ "explode": true,

"in": "cookie",
"description": "A `form` style, exploded object.\n\n> It's unclear whether this encoding is the correct behavior because the `Cookie` header deviates from all other headers.",
"description": "A `form` style, exploded object.\n\n> On ReadMe we encode this kind of parameter within [@readme/httpsnippet](https://npm.im/@readme/httpsnippet) but it's unclear whether this encoding is the correct behavior because the `Cookie` header deviates from all other headers.",
"style": "form",

@@ -866,3 +866,3 @@ "explode": true,

"in": "query",
"description": "A `spaceDelimited` style, non-exploded array.",
"description": "A `spaceDelimited` style, non-exploded array.\n\n>āš ļø This is currently unsupported.",
"style": "spaceDelimited",

@@ -908,3 +908,3 @@ "explode": false,

"in": "query",
"description": "A `pipeDelimited` style, non-exploded object.",
"description": "A `pipeDelimited` style, non-exploded object.\n\n>āš ļø This is currently unsupported.",
"style": "pipeDelimited",

@@ -1127,3 +1127,3 @@ "explode": false,

"object": {
"description": "A `spaceDelimited` style, non-exploded object.",
"description": "A `spaceDelimited` style, non-exploded object.\n\n>āš ļø This is currently unsupported.",
"type": "object",

@@ -1180,3 +1180,3 @@ "properties": {

"object": {
"description": "A `pipeDelimited` style, non-exploded object.",
"description": "A `pipeDelimited` style, non-exploded object.\n\n>āš ļø This is currently unsupported.",
"type": "object",

@@ -1183,0 +1183,0 @@ "properties": {

{
"openapi": "3.1.0",
"servers": [
{
"url": "http://petstore.swagger.io/v2"
}
],
"info": {

@@ -21,2 +16,7 @@ "description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.",

},
"servers": [
{
"url": "http://petstore.swagger.io/v2"
}
],
"externalDocs": {

@@ -23,0 +23,0 @@ "description": "Find out more about Swagger",

@@ -37,2 +37,10 @@ {

"description": "Showcasing handling and support for circular references (`$ref` pointers)."
},
{
"name": "ReadMe-flavors",
"description": "Showcasing handling and support for various ReadMe-flavored schema additions."
},
{
"name": "Quirks",
"description": "Showcasing handling and support for various schema type quirks."
}

@@ -159,2 +167,3 @@ ],

"type": "string",
"description": "This is a special ReadMe data type to render a `<textarea>` to be parsed as JSON",
"format": "json"

@@ -511,3 +520,3 @@ },

"type": "array",
"description": "Techncally this is a malformed schema, but we support it (for legacy reasons) and repair it to have `items: {}` when we generate JSON Schema for the form.\n\nThough its supported, not all OpenAPI validators allow it so support may regress at some point in the future."
"description": "Techncally this is a malformed schema, but we support it (for legacy reasons) and repair it to have `items: {}` when we generate JSON Schema for the form.\n\nThough its supported, not all OpenAPI validators allow it though so our support may regress at some point in the future."
},

@@ -824,2 +833,214 @@ "array<string>": {

}
},
"/anything/raw_body/top-level-payloads": {
"post": {
"operationId": "raw_body_topLevel",
"summary": "Top-level RAW_BODY (string)",
"description": "This is a special value on ReadMe to denote a top level property. This can be done better using JSON Schema, but from ReadMe's dash, this is the only way to do it.\n\n<https://docs.readme.com/docs/raw-body-content>",
"tags": ["ReadMe-flavors"],
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"RAW_BODY": {
"type": "string"
}
}
}
}
}
},
"responses": {
"200": {
"description": "OK"
}
}
},
"patch": {
"operationId": "raw_body_topLevelJSON",
"summary": "Top-level RAW_BODY (JSON)",
"description": "This is a special value on ReadMe to denote a top level property. This can be done better using JSON Schema, but from ReadMe's dash, this is the only way to do it.\n\n<https://docs.readme.com/docs/raw-body-content>",
"tags": ["ReadMe-flavors"],
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"RAW_BODY": {
"type": "string",
"format": "json"
}
}
}
}
}
},
"responses": {
"200": {
"description": "OK"
}
}
}
},
"/anything/quirks": {
"post": {
"operationId": "quirks_missingType",
"summary": "Missing schema type",
"description": "Handling cases for when `type` is missing from a schema.\n\nšŸ“š OpenAPI specification references:\n\n* [3.0.3 Schema Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#schemaObject)\n\n* [3.1.0 Schema Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#schemaObject)",
"tags": ["Quirks"],
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"missing type": {
"description": "Though this request body property is missing a `type` declaration we should stil render a `string` input box so that the user can interact with it.",
"default": "default value"
},
"missing type (on completely empty schema)": {},
"implicit array": {
"description": "This array property is missing an explicit `type: array` but since it has an `items` declaration we're implicitly treating it as an array.",
"items": {
"type": "integer"
}
},
"implicit object": {
"description": "This object property is missing an explicit `type: object` but since it has an `properties` declaration we're implicitly treating it as an object.",
"properties": {
"name": {
"type": "string",
"default": "buster"
}
}
}
}
}
}
}
}
},
"put": {
"operationId": "quirks_unknownType",
"summary": "Unknown schema type",
"description": "Handling cases for when `type` is unrecognized.\n\nšŸ“š OpenAPI specification references:\n\n* [3.0.3 Schema Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#schemaObject)\n\n* [3.1.0 Schema Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#schemaObject)",
"tags": ["Quirks"],
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"param": {
"type": "str",
"description": "This property has a `type` of `str` but since `str` is not a valid JSON Schema type we should fallback to rendering it out as a standard `string` input."
}
}
}
}
}
}
}
},
"/anything/quirks/polymorphism": {
"post": {
"operationId": "quirks_incompatibleNestedAllOf",
"summary": "Incompatible nested allOf schemas",
"description": "Handling cases for when a nested `allOf` cannot be merged together.\n\nšŸ“š OpenAPI specification references:\n\n* [3.0.3 Schema Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#schemaObject)\n\n* [3.1.0 Schema Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#schemaObject)",
"tags": ["Quirks"],
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"incompatible": {
"description": "This property consists of an `allOf` of a `string` and an `integer` schema. Since these two schemas are incompatible and we're unable to merge them per the `allOf` rules, we instead eliminate the `allOf` and render out a `string` instead.\n\nThis is obviously less than ideal but it assures that the user can still interact with the property.",
"allOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"compatible": {
"description": "Unlike the `incompatible` property above this `allOf` consists of two objects that **can** be merged.",
"allOf": [
{
"type": "object",
"properties": {
"name": {
"type": "string"
}
}
},
{
"type": "object",
"properties": {
"name": {
"example": "buster"
}
}
}
]
}
}
}
}
},
"required": true
}
},
"put": {
"operationId": "quirks_entirelyIncompatibleAllOf",
"summary": "Incompatible allOf schemas on a root requestBody",
"description": "When an `allOf` sits at the top of a request body schema and it cannot be merged, we're unable to render out anything for an input because there's no usable schema for us.\n\nšŸ“š OpenAPI specification references:\n\n* [3.0.3 Schema Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#schemaObject)\n\n* [3.1.0 Schema Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#schemaObject)",
"tags": ["Quirks"],
"requestBody": {
"content": {
"application/json": {
"schema": {
"allOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
}
}
},
"required": true
}
},
"patch": {
"operationId": "quirks_partiallyUsableIncompatibleAllOf",
"summary": "Incompatible allOf schemas on a root requestBody (with other schema properties)",
"description": "Like `quirks_entirelyIncompatibleAllOf`, when we're to merge an `allOf` together we eliminate it, however this schema here has additional properties (`description`) alongside that `allOf` so it's not a wholly empty schema and we can use it. Unfortunately since we don't have any of the real data for the request body to use we treat this as a string input with a `format` of `json` so that the user can input a raw JSON input to make their request with.\n\nUnfortunately in this case we don't support `description` on the root schema so it won't show up, but a large input box still will for the user. Obviously all of this less than ideal as we're losing request body schema data but since the `allOf` present is incompatible it's unusable and this is the best we can do under the circumstances.\n\nšŸ“š OpenAPI specification references:\n\n* [3.0.3 Schema Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#schemaObject)\n\n* [3.1.0 Schema Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#schemaObject)",
"tags": ["Quirks"],
"requestBody": {
"content": {
"application/json": {
"schema": {
"description": "I am a description",
"allOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
}
}
},
"required": true
}
}
}

@@ -826,0 +1047,0 @@ },

@@ -12,3 +12,3 @@ {

],
"version": "4.5.0",
"version": "5.0.0",
"repository": {

@@ -15,0 +15,0 @@ "type": "git",

@@ -5,2 +5,4 @@ # @readme/oas-examples

[![Build](https://github.com/readmeio/oas-examples/workflows/CI/badge.svg)](https://github.com/readmeio/oas-examples/) [![](https://img.shields.io/npm/v/@readme/oas-examples)](https://npm.im/@readme/oas-examples)
[![](https://d3vv6lp55qjaqc.cloudfront.net/items/1M3C3j0I0s0j3T362344/Untitled-2.png)](https://readme.io)

@@ -7,0 +9,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with āš”ļø by Socket Inc