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
49
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

to
5.14.0

93

3.0/json/readme-extensions.json

@@ -46,5 +46,62 @@ {

"tags": ["Custom code samples"],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Tag"
},
"examples": {
"userRegistration": {
"value": {
"id": 1234,
"email": "test@example.com",
"name": "Test user name"
}
},
"userRegistration alt": {
"value": {
"id": 5678,
"email": "test@example.com",
"name": "Test user name"
}
}
}
}
}
},
"responses": {
"200": {
"description": "OK"
"description": "OK",
"content": {
"application/json": {
"examples": {
"TestExample": {
"summary": "An example of a cat",
"value": {
"name": "Fluffy",
"petType": "Cat",
"color": "White",
"gender": "male",
"breed": "Persian"
}
}
}
}
}
},
"404": {
"description": "Not Found",
"content": {
"application/json": {
"examples": {
"curlExample": {
"summary": "An example of a cat",
"value": {
"missing": "can't find your stuff dawg"
}
}
}
}
}
}

@@ -58,9 +115,39 @@ },

"code": "curl -X POST https://api.example.com/v2/alert",
"install": "brew install curl"
"install": "brew install curl",
"correspondingExample": "TestExample"
},
{
"name": "Another cURL snippet",
"language": "curl",
"code": "http POST https://api.example.com/v2/another-alert",
"install": "brew install httpie",
"correspondingExample": "curlExample"
},
{
"language": "curl",
"code": "# This custom cURL snippet does not have a custom name so it has the name of \"Default #2\".\n\ncurl -X POST https://api.example.com/v2/alert"
},
{
"name": "Yet another custom snippet",
"language": "curl",
"code": "curl -X POST https://api.example.com/v2/alert",
"install": "brew install curl",
"correspondingExample": "TestExample"
},
{
"name": "Yet another custom snippet",
"language": "python",
"code": "import requests\n\nprint(\"do something idk\")",
"install": "pip install requests",
"correspondingExample": "TestExample"
},
{
"name": "Yet another custom snippet",
"language": "node",
"code": "import something from 'requestidk';\n\nconsole.log('do something idk');",
"install": "npm install requestidk",
"correspondingExample": "curlExample"
}
]
],
"samples-languages": ["shell", "python", "node"]
}

@@ -67,0 +154,0 @@ },

{
"openapi": "3.0.0",
"info": {
"title": "Support for request body examples",
"title": "Support for request body and parameter examples",
"description": "https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#requestBodyObject",

@@ -25,7 +25,294 @@ "version": "1.0.0"

"paths": {
"/parameterExamples/{param1}/{param2}": {
"get": {
"tags": ["Multiple examples"],
"summary": "Within `examples` (parameters)",
"description": "This operation has several parameters with examples alongside separately maintained example within `examples` at the Media Type Object level.\n\n📚 OpenAPI specification references:\n\n* [3.0.3 Media Type Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#mediaTypeObject)\n\n* [3.1.0 Media Type Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#mediaTypeObject)",
"parameters": [
{
"name": "param1",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"examples": {
"userRegistration": {
"summary": "example summary (param 1)",
"description": "a lengthier example description (param 1)",
"value": "param1-example"
},
"yetAnotherParamExample": {
"value": "param1-example-again"
}
}
},
{
"name": "param2",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"examples": {
"userRegistration": {
"summary": "example summary (param 2)",
"description": "a lengthier example description (param 2)",
"value": "param2-example"
}
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/user"
},
"examples": {
"userRegistration": {
"value": {
"summary": "example summary (response)",
"description": "a lengthier example description (response)",
"id": 1234,
"email": "test+response@example.com",
"name": "Test user name (response)"
}
},
"response": {
"value": {
"id": 1234,
"email": "test@example.com",
"name": "Test user name"
}
}
}
}
}
},
"400": {
"description": "Validation failed",
"content": {
"application/xml": {
"examples": {
"response": {
"value": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><note><body>Invalid user!</body></note>"
}
}
}
}
},
"default": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/user"
},
"examples": {
"response": {
"value": {
"id": 1234,
"email": "test@example.com",
"name": "Test user name"
}
}
}
}
}
}
}
},
"patch": {
"tags": ["Multiple examples"],
"summary": "Within `examples` (mixed)",
"description": "This operation has parameter and body examples alongside separately maintained example within `examples` at the Media Type Object level.\n\n📚 OpenAPI specification references:\n\n* [3.0.3 Media Type Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#mediaTypeObject)\n\n* [3.1.0 Media Type Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#mediaTypeObject)",
"parameters": [
{
"name": "param1",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"examples": {
"userRegistration": {
"summary": "example summary (param 1)",
"description": "a lengthier example description (param 1)",
"value": "param1-example"
},
"yetAnotherParamExample": {
"value": "param1-example-again"
}
}
},
{
"name": "param2",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"examples": {
"userRegistration": {
"summary": "example summary (param 2)",
"description": "a lengthier example description (param 2)",
"value": "param2-example"
}
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/user"
},
"examples": {
"userRegistration": {
"value": {
"id": 1234,
"email": "test@example.com",
"name": "Test user name"
}
},
"userRegistration alt": {
"value": {
"id": 5678,
"email": "test@example.com",
"name": "Test user name"
}
}
}
}
}
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/user"
},
"examples": {
"userRegistration": {
"value": {
"summary": "example summary (response)",
"description": "a lengthier example description (response)",
"id": 1234,
"email": "test+response@example.com",
"name": "Test user name (response)"
}
},
"response": {
"value": {
"id": 1234,
"email": "test@example.com",
"name": "Test user name"
}
}
}
}
}
},
"400": {
"description": "Validation failed",
"content": {
"application/xml": {
"examples": {
"response": {
"value": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><note><body>Invalid user!</body></note>"
}
}
}
}
},
"default": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/user"
},
"examples": {
"response": {
"value": {
"id": 1234,
"email": "test@example.com",
"name": "Test user name"
}
}
}
}
}
}
}
},
"put": {
"tags": ["Single example"],
"summary": "Within `example`",
"description": "This operation has a param example and `requestBody` with separately maintained example within a simple `example` object at the Media Type Object level.\n\n📚 OpenAPI specification references:\n\n* [3.0.3 Media Type Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#mediaTypeObject)\n\n* [3.1.0 Media Type Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#mediaTypeObject)",
"parameters": [
{
"name": "param1",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"example": "param1-example"
},
{
"name": "param2",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"example": "param2-example"
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/user"
},
"example": {
"id": 12343354,
"email": "test@example.com",
"name": "Test user name"
}
}
}
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/user"
},
"example": {
"id": 12343354,
"email": "test@example.com",
"name": "Test user name"
}
}
}
}
}
}
},
"/requestBody": {
"post": {
"tags": ["Multiple examples"],
"summary": "Within `examples`",
"description": "This operation has a `requestBody` with separately maintained example within `examples` at the Media Type Object level.\n\n📚 OpenAPI specification references:\n\n* [3.0.3 Media Type Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#mediaTypeObject)\n\n* [3.1.0 Media Type Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#mediaTypeObject)",
"summary": "Within `examples` (body)",
"description": "This operation has a `requestBody` with separately maintained examples within `examples` at the Media Type Object level.\n\n📚 OpenAPI specification references:\n\n* [3.0.3 Media Type Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#mediaTypeObject)\n\n* [3.1.0 Media Type Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#mediaTypeObject)",
"requestBody": {

@@ -66,2 +353,11 @@ "required": true,

"examples": {
"userRegistration": {
"summary": "example summary (response)",
"description": "a lengthier example description (response)",
"value": {
"id": 1234,
"email": "test+response@example.com",
"name": "Test user name (response)"
}
},
"response": {

@@ -68,0 +364,0 @@ "value": {

190

3.1/json/train-travel.json

@@ -25,5 +25,3 @@ {

{
"OAuth2": [
"read"
]
"OAuth2": ["read"]
}

@@ -55,5 +53,3 @@ ],

"operationId": "get-stations",
"tags": [
"Stations"
],
"tags": ["Stations"],
"responses": {

@@ -186,5 +182,3 @@ "200": {

"operationId": "get-trips",
"tags": [
"Trips"
],
"tags": ["Trips"],
"parameters": [

@@ -379,5 +373,3 @@ {

"description": "Returns a list of all trips booking by the authenticated user.",
"tags": [
"Bookings"
],
"tags": ["Bookings"],
"responses": {

@@ -507,10 +499,6 @@ "200": {

"description": "A booking is a temporary hold on a trip. It is not confirmed until the payment is processed.",
"tags": [
"Bookings"
],
"tags": ["Bookings"],
"security": [
{
"OAuth2": [
"write"
]
"OAuth2": ["write"]
}

@@ -620,5 +608,3 @@ ],

"operationId": "get-booking",
"tags": [
"Bookings"
],
"tags": ["Bookings"],
"responses": {

@@ -703,10 +689,6 @@ "200": {

{
"OAuth2": [
"write"
]
"OAuth2": ["write"]
}
],
"tags": [
"Bookings"
],
"tags": ["Bookings"],
"responses": {

@@ -755,5 +737,3 @@ "204": {

"operationId": "create-booking-payment",
"tags": [
"Payments"
],
"tags": ["Payments"],
"requestBody": {

@@ -903,5 +883,3 @@ "content": {

"description": "Subscribe to new bookings being created, to update integrations for your users. Related data is available via the links provided in the request.\n",
"tags": [
"Bookings"
],
"tags": ["Bookings"],
"requestBody": {

@@ -980,8 +958,3 @@ "content": {

},
"required": [
"id",
"name",
"address",
"country_code"
],
"required": ["id", "name", "address", "country_code"],
"properties": {

@@ -992,6 +965,3 @@ "id": {

"description": "Unique identifier for the station.",
"examples": [
"efdbb9d1-02c2-4bc3-afb7-6788d8782b1e",
"b2e783e1-c824-4d63-b37a-d8d698862f1d"
]
"examples": ["efdbb9d1-02c2-4bc3-afb7-6788d8782b1e", "b2e783e1-c824-4d63-b37a-d8d698862f1d"]
},

@@ -1001,6 +971,3 @@ "name": {

"description": "The name of the station",
"examples": [
"Berlin Hauptbahnhof",
"Paris Gare du Nord"
]
"examples": ["Berlin Hauptbahnhof", "Paris Gare du Nord"]
},

@@ -1010,6 +977,3 @@ "address": {

"description": "The address of the station.",
"examples": [
"Invalidenstraße 10557 Berlin, Germany",
"18 Rue de Dunkerque 75010 Paris, France"
]
"examples": ["Invalidenstraße 10557 Berlin, Germany", "18 Rue de Dunkerque 75010 Paris, France"]
},

@@ -1020,6 +984,3 @@ "country_code": {

"format": "iso-country-code",
"examples": [
"DE",
"FR"
]
"examples": ["DE", "FR"]
},

@@ -1029,6 +990,3 @@ "timezone": {

"description": "The timezone of the station in the [IANA Time Zone Database format](https://www.iana.org/time-zones).",
"examples": [
"Europe/Berlin",
"Europe/Paris"
]
"examples": ["Europe/Berlin", "Europe/Paris"]
}

@@ -1102,5 +1060,3 @@ }

"description": "Unique identifier for the trip",
"examples": [
"4f4e4e1-c824-4d63-b37a-d8d698862f1d"
]
"examples": ["4f4e4e1-c824-4d63-b37a-d8d698862f1d"]
},

@@ -1110,6 +1066,3 @@ "origin": {

"description": "The starting station of the trip",
"examples": [
"Berlin Hauptbahnhof",
"Paris Gare du Nord"
]
"examples": ["Berlin Hauptbahnhof", "Paris Gare du Nord"]
},

@@ -1119,6 +1072,3 @@ "destination": {

"description": "The destination station of the trip",
"examples": [
"Paris Gare du Nord",
"Berlin Hauptbahnhof"
]
"examples": ["Paris Gare du Nord", "Berlin Hauptbahnhof"]
},

@@ -1129,5 +1079,3 @@ "departure_time": {

"description": "The date and time when the trip departs",
"examples": [
"2024-02-01T10:00:00Z"
]
"examples": ["2024-02-01T10:00:00Z"]
},

@@ -1138,5 +1086,3 @@ "arrival_time": {

"description": "The date and time when the trip arrives",
"examples": [
"2024-02-01T16:00:00Z"
]
"examples": ["2024-02-01T16:00:00Z"]
},

@@ -1146,6 +1092,3 @@ "operator": {

"description": "The name of the operator of the trip",
"examples": [
"Deutsche Bahn",
"SNCF"
]
"examples": ["Deutsche Bahn", "SNCF"]
},

@@ -1155,5 +1098,3 @@ "price": {

"description": "The cost of the trip",
"examples": [
50
]
"examples": [50]
},

@@ -1181,5 +1122,3 @@ "bicycles_allowed": {

"readOnly": true,
"examples": [
"3f3e3e1-c824-4d63-b37a-d8d698862f1d"
]
"examples": ["3f3e3e1-c824-4d63-b37a-d8d698862f1d"]
},

@@ -1190,5 +1129,3 @@ "trip_id": {

"description": "Identifier of the booked trip",
"examples": [
"4f4e4e1-c824-4d63-b37a-d8d698862f1d"
]
"examples": ["4f4e4e1-c824-4d63-b37a-d8d698862f1d"]
},

@@ -1198,5 +1135,3 @@ "passenger_name": {

"description": "Name of the passenger",
"examples": [
"John Doe"
]
"examples": ["John Doe"]
},

@@ -1247,5 +1182,3 @@ "has_bicycle": {

"exclusiveMinimum": 0,
"examples": [
49.99
]
"examples": [49.99]
},

@@ -1255,12 +1188,3 @@ "currency": {

"type": "string",
"enum": [
"bam",
"bgn",
"chf",
"eur",
"gbp",
"nok",
"sek",
"try"
]
"enum": ["bam", "bgn", "chf", "eur", "gbp", "nok", "sek", "try"]
},

@@ -1282,5 +1206,3 @@ "source": {

"description": "Cardholder's full name as it appears on the card.",
"examples": [
"Francis Bourgeois"
]
"examples": ["Francis Bourgeois"]
},

@@ -1290,5 +1212,3 @@ "number": {

"description": "The card number, as a string without any separators. On read all but the last four digits will be masked for security.",
"examples": [
"4242424242424242"
]
"examples": ["4242424242424242"]
},

@@ -1307,5 +1227,3 @@ "cvc": {

"description": "Two-digit number representing the card's expiration month.",
"examples": [
12
]
"examples": [12]
},

@@ -1316,5 +1234,3 @@ "exp_year": {

"description": "Four-digit number representing the card's expiration year.",
"examples": [
2025
]
"examples": [2025]
},

@@ -1339,10 +1255,3 @@ "address_line1": {

},
"required": [
"name",
"number",
"cvc",
"exp_month",
"exp_year",
"address_country"
]
"required": ["name", "number", "cvc", "exp_month", "exp_year", "address_country"]
},

@@ -1370,6 +1279,3 @@ {

"account_type": {
"enum": [
"individual",
"company"
],
"enum": ["individual", "company"],
"type": "string",

@@ -1381,5 +1287,3 @@ "description": "The type of entity that holds the account. This can be either `individual` or `company`."

"description": "The name of the bank associated with the routing number.",
"examples": [
"Starling Bank"
]
"examples": ["Starling Bank"]
},

@@ -1391,9 +1295,3 @@ "country": {

},
"required": [
"name",
"number",
"account_type",
"bank_name",
"country"
]
"required": ["name", "number", "account_type", "bank_name", "country"]
}

@@ -1405,7 +1303,3 @@ ]

"type": "string",
"enum": [
"pending",
"succeeded",
"failed"
],
"enum": ["pending", "succeeded", "failed"],
"readOnly": true

@@ -1421,5 +1315,3 @@ }

"format": "uri",
"examples": [
"https://api.example.com/bookings/1725ff48-ab45-4bb5-9d02-88745177dedb"
]
"examples": ["https://api.example.com/bookings/1725ff48-ab45-4bb5-9d02-88745177dedb"]
}

@@ -1434,5 +1326,3 @@ }

"type": "string",
"examples": [
"limit=10, remaining=0, reset=10"
]
"examples": ["limit=10, remaining=0, reset=10"]
}

@@ -1439,0 +1329,0 @@ },

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

],
"version": "5.13.0",
"version": "5.14.0",
"repository": {

@@ -22,9 +22,9 @@ "type": "git",

"scripts": {
"lint": "eslint .",
"lint": "eslint . && prettier --check .",
"pretest": "npm run lint",
"prettier": "prettier --list-different --write \"./**/**.{js,json,md,yaml}\"",
"prettier": "prettier --check --write .",
"test": "vitest run"
},
"devDependencies": {
"@readme/eslint-config": "^13.5.0",
"@readme/eslint-config": "^14.0.0",
"@readme/openapi-parser": "^2.5.0",

@@ -31,0 +31,0 @@ "eslint": "^8.57.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 not supported yet