diff --git a/scripts/validation/base-doc.json b/scripts/validation/base-doc.json index 831e7ec0..d82b6515 100644 --- a/scripts/validation/base-doc.json +++ b/scripts/validation/base-doc.json @@ -227,7 +227,8 @@ "$ref": "#/channels/userSignupReply/messages/userSignedUpReply" } ] - } + }, + "traits":[] } }, "components": { @@ -425,7 +426,8 @@ }, "bindings": { "$ref": "#/components/messageBindings/user" - } + }, + "examples":[] }, "userSignedUp": { "name": "UserSignup", @@ -488,6 +490,25 @@ } ] }, + "userSignedUpReply":{ + "name": "UserSignupReply", + "title": "User signup reply", + "summary": "User signup reply message", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + }, "userCompletedOrder": { "summary": "User completed order event", "contentType": "application/json", diff --git a/scripts/validation/embedded-examples-validation.js b/scripts/validation/embedded-examples-validation.js index bb70294a..22eaf7de 100644 --- a/scripts/validation/embedded-examples-validation.js +++ b/scripts/validation/embedded-examples-validation.js @@ -131,7 +131,13 @@ function applyUpdatesAndSave(updates, baseDocPath, outputPath) { const parent = result.parent; const parentProperty = result.parentProperty; console.log(`\nMerging data at path: '${update.json_path}'`); - parent[parentProperty] = deepMerge(parent[parentProperty], dataToMerge); // Deep merge the existing data with the new data + if (Array.isArray(parent[parentProperty])) { + // If the existing data is an array, add the update data as an array item + parent[parentProperty].push(dataToMerge); + } else { + // Otherwise, deep merge the existing data with the new data + parent[parentProperty] = deepMerge(parent[parentProperty], dataToMerge); + } }); } } @@ -145,13 +151,10 @@ function applyUpdatesAndSave(updates, baseDocPath, outputPath) { // Iterate over the combinedData array and apply updates for each item const outputDir = path.join(__dirname, 'updated-docs'); const validationPromises = []; // Array to store all validation promises -combinedData.forEach((item, index) => { +combinedData.forEach((item) => { const baseDocPath = item.name && item.name.includes("Security Scheme Object") ? 'base-doc-security-scheme-object.json' : 'base-doc.json'; - // use this line for final version - // const outputPath = `./updated-docs/${item.name}.json`; - // Check if the directory exists, and if not, create it if (!fs.existsSync(outputDir)) { @@ -166,16 +169,16 @@ combinedData.forEach((item, index) => { // Apply updates and save the document applyUpdatesAndSave([item], baseDocPath, outputPath); - // Validate the output file - // validateParser(outputPath); + // Validate the output file using the AsyncAPI parser + // const validationPromise = validateParser(outputPath); // Use the AsyncAPI CLI to validate the output file const validationPromise = validateCli(outputPath) .then((output) => { - console.log('\nValidation output:', output); + console.log(`\n${output}`); }) .catch((error) => { - console.error('Validation error:', error); + console.error(error); }); // Delete the updated document after saving // fs.unlinkSync(outputPath); @@ -194,11 +197,11 @@ async function validateParser(filePath) { if (diagnostic.level === 'error') { console.error(`Error in ${filePath}: ${diagnostic.message}`); } else { - console.log(`\n\nWarning in ${filePath}: ${diagnostic.message}`); + console.log(`Warning in ${filePath}: ${diagnostic.message}`); } }); } else { - console.log(`\n\n${filePath} is valid.`); + console.log(`${filePath} is valid.`); } } catch (error) { console.error(`Validation failed for ${filePath}: ${error.message}`); @@ -209,7 +212,7 @@ async function validateParser(filePath) { async function validateCli(filePath) { return new Promise((resolve, reject) => { // Construct the command to run the AsyncAPI CLI validate command - const command = `npx asyncapi validate ${path.resolve(filePath)}`; + const command = `npx asyncapi validate ${filePath}`; exec(command, (error, stdout, stderr) => { if (error) { @@ -258,16 +261,16 @@ console.log(`\nNumber of examples extracted: ${combinedData.length}`); // fs.writeFileSync(`extracted-examples.json`, JSON.stringify(combinedData, null, 2), 'utf8'); -let num = 43; -const currentExample = JSON.stringify(combinedData[num-1], null, 2); -console.log(`\nexample ${num} = ${currentExample} `) +// let num = 43; +// const currentExample = JSON.stringify(combinedData[num-1], null, 2); +// console.log(`\nexample ${num} = ${currentExample} `) // console.log(`\n${combinedData[num-1].name} = ${currentExample}`); // Wait for all validation promises to resolve Promise.all(validationPromises) .then(() => { // All validations are complete, delete the folder - deleteFolderRecursive(outputDir); + // deleteFolderRecursive(outputDir); // Commented out to keep the updated files for debugging }) .catch((error) => { console.error('Error during validations:', error); diff --git a/scripts/validation/updated-docs/Channel-Object.json b/scripts/validation/updated-docs/Channel-Object.json new file mode 100644 index 00000000..1819e32b --- /dev/null +++ b/scripts/validation/updated-docs/Channel-Object.json @@ -0,0 +1,692 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "AsyncAPI", + "version": "1.x.x", + "description": "This is a very good base doc, probably.", + "termsOfService": "https://asyncapi.org/terms/", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ] + }, + "servers": { + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Production RabbitMQ broker (uses the `production` vhost).", + "title": "Production Server", + "summary": "Production environment server", + "security": [ + { + "type": "http", + "scheme": "bearer" + } + ], + "tags": [ + { + "name": "production", + "description": "Production environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the production server", + "url": "https://example.com/docs/production" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "staging": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Staging RabbitMQ broker (uses the `staging` vhost).", + "title": "Staging Server", + "summary": "Staging environment server", + "security": [ + { + "type": "apiKey", + "in": "user", + "description": "Provide your API key as the user and leave the password empty." + } + ], + "tags": [ + { + "name": "staging", + "description": "Staging environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the staging server", + "url": "https://example.com/docs/staging" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "rabbitmqInProd": { + "host": "{prod}.in.mycompany.com", + "protocol": "amqp", + "description": "Production server" + }, + "rabbitmqInStaging": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "Staging server" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + }, + "userCompletedOrder": { + "$ref": "#/components/messages/userCompletedOrder" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/servers/rabbitmqInProd" + }, + { + "$ref": "#/servers/rabbitmqInStaging" + } + ], + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + }, + "tags": [ + { + "name": "user", + "description": "User-related messages" + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + }, + "userSignup": { + "address": "users.signup", + "description": "Channel for user signups", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + }, + "userSignupReply": { + "address": "users.signup.reply", + "description": "Channel for user signup replies", + "messages": { + "userSignedUpReply": { + "summary": "User signup reply message", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + } + } + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/user" + }, + "security": [ + { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "messages": [ + { + "$ref": "#/channels/user/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "#/channels/userSignupReply/messages/userSignedUpReply" + } + ] + }, + "traits": [] + } + }, + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type": "record", + "name": "UserCreate", + "namespace": "com.example", + "fields": [ + { + "name": "id", + "type": "int" + }, + { + "name": "name", + "type": "string" + } + ] + } + }, + "userCreate": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the user" + }, + "name": { + "type": "string", + "description": "The name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "The email of the user" + } + }, + "required": [ + "id", + "name", + "email" + ] + }, + "signup": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the signup" + }, + "source": { + "type": "string", + "description": "The source of the signup" + } + }, + "required": [ + "timestamp", + "source" + ] + }, + "ComplexModel": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "zip": { + "type": "string" + } + } + }, + "ErrorModel": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } + } + }, + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "RabbitMQ broker", + "bindings": { + "$ref": "#/components/serverBindings/devAmqp" + }, + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + } + }, + "security": [ + { + "$ref": "#/components/securitySchemes/oauth" + } + ] + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider in this example of `mycompany.com`" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignUp" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/components/servers/development" + } + ], + "bindings": { + "$ref": "#/components/channelBindings/user" + }, + "tags": [ + { + "$ref": "#/components/tags/user" + } + ], + "externalDocs": { + "$ref": "#/components/externalDocs/infoDocs" + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "payload": { + "$ref": "#/components/schemas/Category" + }, + "correlationId": { + "$ref": "#/components/correlationIds/default" + }, + "bindings": { + "$ref": "#/components/messageBindings/user" + }, + "examples": [] + }, + "userSignedUp": { + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + }, + "userSignedUpReply": { + "name": "UserSignupReply", + "title": "User signup reply", + "summary": "User signup reply message", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + }, + "userCompletedOrder": { + "summary": "User completed order event", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The ID of the order" + }, + "userId": { + "type": "string", + "description": "The ID of the user" + }, + "amount": { + "type": "number", + "description": "The total amount of the order" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "channel": { + "$ref": "#/channels/user" + }, + "bindings": { + "$ref": "#/components/operationBindings/sendUser" + }, + "traits": [ + { + "$ref": "#/components/operationTraits/binding" + } + ], + "reply": { + "$ref": "#/components/replies/signupReply" + } + } + }, + "replies": { + "signupReply": { + "address": { + "$ref": "#/components/replyAddresses/signupReply" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + } + } + }, + "replyAddresses": { + "signupReply": { + "location": "$message.header#/replyTo" + } + }, + "securitySchemes": { + "oauth": { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + }, + "operationTraits": { + "binding": { + "bindings": { + "amqp": { + "ack": false + } + } + }, + "kafka": { + "bindings": { + "kafka": { + "groupId": false + } + } + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + }, + "tags": { + "user": { + "name": "user", + "description": "User-related messages" + } + }, + "externalDocs": { + "infoDocs": { + "url": "https://example.com/docs", + "description": "Find more info here" + } + }, + "serverBindings": { + "devAmqp": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "channelBindings": { + "user": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + } + }, + "operationBindings": { + "sendUser": { + "amqp": { + "ack": false + } + } + }, + "messageBindings": { + "user": { + "amqp": { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + } + } + } +} \ No newline at end of file diff --git a/scripts/validation/updated-docs/Channel-Parameter-Object.json b/scripts/validation/updated-docs/Channel-Parameter-Object.json new file mode 100644 index 00000000..53c10327 --- /dev/null +++ b/scripts/validation/updated-docs/Channel-Parameter-Object.json @@ -0,0 +1,691 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "AsyncAPI", + "version": "1.x.x", + "description": "This is a very good base doc, probably.", + "termsOfService": "https://asyncapi.org/terms/", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ] + }, + "servers": { + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Production RabbitMQ broker (uses the `production` vhost).", + "title": "Production Server", + "summary": "Production environment server", + "security": [ + { + "type": "http", + "scheme": "bearer" + } + ], + "tags": [ + { + "name": "production", + "description": "Production environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the production server", + "url": "https://example.com/docs/production" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "staging": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Staging RabbitMQ broker (uses the `staging` vhost).", + "title": "Staging Server", + "summary": "Staging environment server", + "security": [ + { + "type": "apiKey", + "in": "user", + "description": "Provide your API key as the user and leave the password empty." + } + ], + "tags": [ + { + "name": "staging", + "description": "Staging environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the staging server", + "url": "https://example.com/docs/staging" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "rabbitmqInProd": { + "host": "{prod}.in.mycompany.com", + "protocol": "amqp", + "description": "Production server" + }, + "rabbitmqInStaging": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "Staging server" + } + }, + "channels": { + "user": { + "address": "user/{userId}/signedup", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + }, + "userCompletedOrder": { + "$ref": "#/components/messages/userCompletedOrder" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId", + "description": "Id of the user.", + "location": "$message.payload#/user/id" + } + }, + "servers": [ + { + "$ref": "#/servers/production" + } + ], + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + }, + "tags": [ + { + "name": "user", + "description": "User-related messages" + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + }, + "userSignup": { + "address": "users.signup", + "description": "Channel for user signups", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + }, + "userSignupReply": { + "address": "users.signup.reply", + "description": "Channel for user signup replies", + "messages": { + "userSignedUpReply": { + "summary": "User signup reply message", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + } + } + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/user" + }, + "security": [ + { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "messages": [ + { + "$ref": "#/channels/user/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "#/channels/userSignupReply/messages/userSignedUpReply" + } + ] + }, + "traits": [] + } + }, + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type": "record", + "name": "UserCreate", + "namespace": "com.example", + "fields": [ + { + "name": "id", + "type": "int" + }, + { + "name": "name", + "type": "string" + } + ] + } + }, + "userCreate": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the user" + }, + "name": { + "type": "string", + "description": "The name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "The email of the user" + } + }, + "required": [ + "id", + "name", + "email" + ] + }, + "signup": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the signup" + }, + "source": { + "type": "string", + "description": "The source of the signup" + } + }, + "required": [ + "timestamp", + "source" + ] + }, + "ComplexModel": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "zip": { + "type": "string" + } + } + }, + "ErrorModel": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } + } + }, + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "RabbitMQ broker", + "bindings": { + "$ref": "#/components/serverBindings/devAmqp" + }, + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + } + }, + "security": [ + { + "$ref": "#/components/securitySchemes/oauth" + } + ] + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider in this example of `mycompany.com`" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignUp" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/components/servers/development" + } + ], + "bindings": { + "$ref": "#/components/channelBindings/user" + }, + "tags": [ + { + "$ref": "#/components/tags/user" + } + ], + "externalDocs": { + "$ref": "#/components/externalDocs/infoDocs" + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "payload": { + "$ref": "#/components/schemas/Category" + }, + "correlationId": { + "$ref": "#/components/correlationIds/default" + }, + "bindings": { + "$ref": "#/components/messageBindings/user" + }, + "examples": [] + }, + "userSignedUp": { + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + }, + "userSignedUpReply": { + "name": "UserSignupReply", + "title": "User signup reply", + "summary": "User signup reply message", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + }, + "userCompletedOrder": { + "summary": "User completed order event", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The ID of the order" + }, + "userId": { + "type": "string", + "description": "The ID of the user" + }, + "amount": { + "type": "number", + "description": "The total amount of the order" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "channel": { + "$ref": "#/channels/user" + }, + "bindings": { + "$ref": "#/components/operationBindings/sendUser" + }, + "traits": [ + { + "$ref": "#/components/operationTraits/binding" + } + ], + "reply": { + "$ref": "#/components/replies/signupReply" + } + } + }, + "replies": { + "signupReply": { + "address": { + "$ref": "#/components/replyAddresses/signupReply" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + } + } + }, + "replyAddresses": { + "signupReply": { + "location": "$message.header#/replyTo" + } + }, + "securitySchemes": { + "oauth": { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + }, + "operationTraits": { + "binding": { + "bindings": { + "amqp": { + "ack": false + } + } + }, + "kafka": { + "bindings": { + "kafka": { + "groupId": false + } + } + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + }, + "tags": { + "user": { + "name": "user", + "description": "User-related messages" + } + }, + "externalDocs": { + "infoDocs": { + "url": "https://example.com/docs", + "description": "Find more info here" + } + }, + "serverBindings": { + "devAmqp": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "channelBindings": { + "user": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + } + }, + "operationBindings": { + "sendUser": { + "amqp": { + "ack": false + } + } + }, + "messageBindings": { + "user": { + "amqp": { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + } + } + } +} \ No newline at end of file diff --git a/scripts/validation/updated-docs/Channel-Parameters-Object.json b/scripts/validation/updated-docs/Channel-Parameters-Object.json new file mode 100644 index 00000000..91d426d6 --- /dev/null +++ b/scripts/validation/updated-docs/Channel-Parameters-Object.json @@ -0,0 +1,690 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "AsyncAPI", + "version": "1.x.x", + "description": "This is a very good base doc, probably.", + "termsOfService": "https://asyncapi.org/terms/", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ] + }, + "servers": { + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Production RabbitMQ broker (uses the `production` vhost).", + "title": "Production Server", + "summary": "Production environment server", + "security": [ + { + "type": "http", + "scheme": "bearer" + } + ], + "tags": [ + { + "name": "production", + "description": "Production environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the production server", + "url": "https://example.com/docs/production" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "staging": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Staging RabbitMQ broker (uses the `staging` vhost).", + "title": "Staging Server", + "summary": "Staging environment server", + "security": [ + { + "type": "apiKey", + "in": "user", + "description": "Provide your API key as the user and leave the password empty." + } + ], + "tags": [ + { + "name": "staging", + "description": "Staging environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the staging server", + "url": "https://example.com/docs/staging" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "rabbitmqInProd": { + "host": "{prod}.in.mycompany.com", + "protocol": "amqp", + "description": "Production server" + }, + "rabbitmqInStaging": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "Staging server" + } + }, + "channels": { + "user": { + "address": "user/{userId}/signedup", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + }, + "userCompletedOrder": { + "$ref": "#/components/messages/userCompletedOrder" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId", + "description": "Id of the user." + } + }, + "servers": [ + { + "$ref": "#/servers/production" + } + ], + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + }, + "tags": [ + { + "name": "user", + "description": "User-related messages" + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + }, + "userSignup": { + "address": "users.signup", + "description": "Channel for user signups", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + }, + "userSignupReply": { + "address": "users.signup.reply", + "description": "Channel for user signup replies", + "messages": { + "userSignedUpReply": { + "summary": "User signup reply message", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + } + } + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/user" + }, + "security": [ + { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "messages": [ + { + "$ref": "#/channels/user/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "#/channels/userSignupReply/messages/userSignedUpReply" + } + ] + }, + "traits": [] + } + }, + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type": "record", + "name": "UserCreate", + "namespace": "com.example", + "fields": [ + { + "name": "id", + "type": "int" + }, + { + "name": "name", + "type": "string" + } + ] + } + }, + "userCreate": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the user" + }, + "name": { + "type": "string", + "description": "The name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "The email of the user" + } + }, + "required": [ + "id", + "name", + "email" + ] + }, + "signup": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the signup" + }, + "source": { + "type": "string", + "description": "The source of the signup" + } + }, + "required": [ + "timestamp", + "source" + ] + }, + "ComplexModel": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "zip": { + "type": "string" + } + } + }, + "ErrorModel": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } + } + }, + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "RabbitMQ broker", + "bindings": { + "$ref": "#/components/serverBindings/devAmqp" + }, + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + } + }, + "security": [ + { + "$ref": "#/components/securitySchemes/oauth" + } + ] + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider in this example of `mycompany.com`" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignUp" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/components/servers/development" + } + ], + "bindings": { + "$ref": "#/components/channelBindings/user" + }, + "tags": [ + { + "$ref": "#/components/tags/user" + } + ], + "externalDocs": { + "$ref": "#/components/externalDocs/infoDocs" + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "payload": { + "$ref": "#/components/schemas/Category" + }, + "correlationId": { + "$ref": "#/components/correlationIds/default" + }, + "bindings": { + "$ref": "#/components/messageBindings/user" + }, + "examples": [] + }, + "userSignedUp": { + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + }, + "userSignedUpReply": { + "name": "UserSignupReply", + "title": "User signup reply", + "summary": "User signup reply message", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + }, + "userCompletedOrder": { + "summary": "User completed order event", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The ID of the order" + }, + "userId": { + "type": "string", + "description": "The ID of the user" + }, + "amount": { + "type": "number", + "description": "The total amount of the order" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "channel": { + "$ref": "#/channels/user" + }, + "bindings": { + "$ref": "#/components/operationBindings/sendUser" + }, + "traits": [ + { + "$ref": "#/components/operationTraits/binding" + } + ], + "reply": { + "$ref": "#/components/replies/signupReply" + } + } + }, + "replies": { + "signupReply": { + "address": { + "$ref": "#/components/replyAddresses/signupReply" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + } + } + }, + "replyAddresses": { + "signupReply": { + "location": "$message.header#/replyTo" + } + }, + "securitySchemes": { + "oauth": { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + }, + "operationTraits": { + "binding": { + "bindings": { + "amqp": { + "ack": false + } + } + }, + "kafka": { + "bindings": { + "kafka": { + "groupId": false + } + } + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + }, + "tags": { + "user": { + "name": "user", + "description": "User-related messages" + } + }, + "externalDocs": { + "infoDocs": { + "url": "https://example.com/docs", + "description": "Find more info here" + } + }, + "serverBindings": { + "devAmqp": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "channelBindings": { + "user": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + } + }, + "operationBindings": { + "sendUser": { + "amqp": { + "ack": false + } + } + }, + "messageBindings": { + "user": { + "amqp": { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + } + } + } +} \ No newline at end of file diff --git a/scripts/validation/updated-docs/Channels-Object.json b/scripts/validation/updated-docs/Channels-Object.json new file mode 100644 index 00000000..0886aeb7 --- /dev/null +++ b/scripts/validation/updated-docs/Channels-Object.json @@ -0,0 +1,697 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "AsyncAPI", + "version": "1.x.x", + "description": "This is a very good base doc, probably.", + "termsOfService": "https://asyncapi.org/terms/", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ] + }, + "servers": { + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Production RabbitMQ broker (uses the `production` vhost).", + "title": "Production Server", + "summary": "Production environment server", + "security": [ + { + "type": "http", + "scheme": "bearer" + } + ], + "tags": [ + { + "name": "production", + "description": "Production environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the production server", + "url": "https://example.com/docs/production" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "staging": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Staging RabbitMQ broker (uses the `staging` vhost).", + "title": "Staging Server", + "summary": "Staging environment server", + "security": [ + { + "type": "apiKey", + "in": "user", + "description": "Provide your API key as the user and leave the password empty." + } + ], + "tags": [ + { + "name": "staging", + "description": "Staging environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the staging server", + "url": "https://example.com/docs/staging" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "rabbitmqInProd": { + "host": "{prod}.in.mycompany.com", + "protocol": "amqp", + "description": "Production server" + }, + "rabbitmqInStaging": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "Staging server" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + }, + "userCompletedOrder": { + "$ref": "#/components/messages/userCompletedOrder" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/servers/production" + } + ], + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + }, + "tags": [ + { + "name": "user", + "description": "User-related messages" + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + }, + "userSignup": { + "address": "users.signup", + "description": "Channel for user signups", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + }, + "userSignupReply": { + "address": "users.signup.reply", + "description": "Channel for user signup replies", + "messages": { + "userSignedUpReply": { + "summary": "User signup reply message", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + } + } + }, + "userSignedUp": { + "address": "user.signedup", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/user" + }, + "security": [ + { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "messages": [ + { + "$ref": "#/channels/user/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "#/channels/userSignupReply/messages/userSignedUpReply" + } + ] + }, + "traits": [] + } + }, + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type": "record", + "name": "UserCreate", + "namespace": "com.example", + "fields": [ + { + "name": "id", + "type": "int" + }, + { + "name": "name", + "type": "string" + } + ] + } + }, + "userCreate": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the user" + }, + "name": { + "type": "string", + "description": "The name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "The email of the user" + } + }, + "required": [ + "id", + "name", + "email" + ] + }, + "signup": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the signup" + }, + "source": { + "type": "string", + "description": "The source of the signup" + } + }, + "required": [ + "timestamp", + "source" + ] + }, + "ComplexModel": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "zip": { + "type": "string" + } + } + }, + "ErrorModel": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } + } + }, + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "RabbitMQ broker", + "bindings": { + "$ref": "#/components/serverBindings/devAmqp" + }, + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + } + }, + "security": [ + { + "$ref": "#/components/securitySchemes/oauth" + } + ] + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider in this example of `mycompany.com`" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignUp" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/components/servers/development" + } + ], + "bindings": { + "$ref": "#/components/channelBindings/user" + }, + "tags": [ + { + "$ref": "#/components/tags/user" + } + ], + "externalDocs": { + "$ref": "#/components/externalDocs/infoDocs" + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "payload": { + "$ref": "#/components/schemas/Category" + }, + "correlationId": { + "$ref": "#/components/correlationIds/default" + }, + "bindings": { + "$ref": "#/components/messageBindings/user" + }, + "examples": [] + }, + "userSignedUp": { + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + }, + "userSignedUpReply": { + "name": "UserSignupReply", + "title": "User signup reply", + "summary": "User signup reply message", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + }, + "userCompletedOrder": { + "summary": "User completed order event", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The ID of the order" + }, + "userId": { + "type": "string", + "description": "The ID of the user" + }, + "amount": { + "type": "number", + "description": "The total amount of the order" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "channel": { + "$ref": "#/channels/user" + }, + "bindings": { + "$ref": "#/components/operationBindings/sendUser" + }, + "traits": [ + { + "$ref": "#/components/operationTraits/binding" + } + ], + "reply": { + "$ref": "#/components/replies/signupReply" + } + } + }, + "replies": { + "signupReply": { + "address": { + "$ref": "#/components/replyAddresses/signupReply" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + } + } + }, + "replyAddresses": { + "signupReply": { + "location": "$message.header#/replyTo" + } + }, + "securitySchemes": { + "oauth": { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + }, + "operationTraits": { + "binding": { + "bindings": { + "amqp": { + "ack": false + } + } + }, + "kafka": { + "bindings": { + "kafka": { + "groupId": false + } + } + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + }, + "tags": { + "user": { + "name": "user", + "description": "User-related messages" + } + }, + "externalDocs": { + "infoDocs": { + "url": "https://example.com/docs", + "description": "Find more info here" + } + }, + "serverBindings": { + "devAmqp": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "channelBindings": { + "user": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + } + }, + "operationBindings": { + "sendUser": { + "amqp": { + "ack": false + } + } + }, + "messageBindings": { + "user": { + "amqp": { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + } + } + } +} \ No newline at end of file diff --git a/scripts/validation/updated-docs/Components-Object.json b/scripts/validation/updated-docs/Components-Object.json new file mode 100644 index 00000000..d10b13cd --- /dev/null +++ b/scripts/validation/updated-docs/Components-Object.json @@ -0,0 +1,750 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "AsyncAPI", + "version": "1.x.x", + "description": "This is a very good base doc, probably.", + "termsOfService": "https://asyncapi.org/terms/", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ] + }, + "servers": { + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Production RabbitMQ broker (uses the `production` vhost).", + "title": "Production Server", + "summary": "Production environment server", + "security": [ + { + "type": "http", + "scheme": "bearer" + } + ], + "tags": [ + { + "name": "production", + "description": "Production environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the production server", + "url": "https://example.com/docs/production" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "staging": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Staging RabbitMQ broker (uses the `staging` vhost).", + "title": "Staging Server", + "summary": "Staging environment server", + "security": [ + { + "type": "apiKey", + "in": "user", + "description": "Provide your API key as the user and leave the password empty." + } + ], + "tags": [ + { + "name": "staging", + "description": "Staging environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the staging server", + "url": "https://example.com/docs/staging" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "rabbitmqInProd": { + "host": "{prod}.in.mycompany.com", + "protocol": "amqp", + "description": "Production server" + }, + "rabbitmqInStaging": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "Staging server" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + }, + "userCompletedOrder": { + "$ref": "#/components/messages/userCompletedOrder" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/servers/production" + } + ], + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + }, + "tags": [ + { + "name": "user", + "description": "User-related messages" + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + }, + "userSignup": { + "address": "users.signup", + "description": "Channel for user signups", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + }, + "userSignupReply": { + "address": "users.signup.reply", + "description": "Channel for user signup replies", + "messages": { + "userSignedUpReply": { + "summary": "User signup reply message", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + } + } + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/user" + }, + "security": [ + { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "messages": [ + { + "$ref": "#/channels/user/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "#/channels/userSignupReply/messages/userSignedUpReply" + } + ] + }, + "traits": [] + } + }, + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type": "record", + "name": "UserCreate", + "namespace": "com.example", + "fields": [ + { + "name": "id", + "type": "int" + }, + { + "name": "name", + "type": "string" + } + ], + "$ref": "path/to/user-create.avsc#/UserCreate" + } + }, + "userCreate": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the user" + }, + "name": { + "type": "string", + "description": "The name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "The email of the user" + } + }, + "required": [ + "id", + "name", + "email" + ] + }, + "signup": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the signup" + }, + "source": { + "type": "string", + "description": "The source of the signup" + } + }, + "required": [ + "timestamp", + "source" + ] + }, + "ComplexModel": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "zip": { + "type": "string" + } + } + }, + "ErrorModel": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } + } + }, + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + }, + "Tag": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com:{port}", + "protocol": "amqp", + "description": "RabbitMQ broker", + "bindings": { + "$ref": "#/components/serverBindings/devAmqp" + }, + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + }, + "port": { + "$ref": "#/components/serverVariables/port" + } + }, + "security": [ + { + "$ref": "#/components/securitySchemes/oauth" + } + ], + "protocolVersion": "0-9-1" + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider, in this example `mycompany.com`" + }, + "port": { + "enum": [ + "5671", + "5672" + ], + "default": "5672" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignUp" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/components/servers/development" + } + ], + "bindings": { + "$ref": "#/components/channelBindings/user" + }, + "tags": [ + { + "$ref": "#/components/tags/user" + } + ], + "externalDocs": { + "$ref": "#/components/externalDocs/infoDocs" + } + }, + "user/signedup": { + "subscribe": { + "message": { + "$ref": "#/components/messages/userSignUp" + } + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "payload": { + "$ref": "#/components/schemas/Category", + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "$ref": "#/components/correlationIds/default" + }, + "bindings": { + "$ref": "#/components/messageBindings/user" + }, + "examples": [], + "description": "Multiline description of what this action does.\nHere you have another line.\n", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + } + ], + "headers": { + "type": "object", + "properties": { + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + } + }, + "userSignedUp": { + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + }, + "userSignedUpReply": { + "name": "UserSignupReply", + "title": "User signup reply", + "summary": "User signup reply message", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + }, + "userCompletedOrder": { + "summary": "User completed order event", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The ID of the order" + }, + "userId": { + "type": "string", + "description": "The ID of the user" + }, + "amount": { + "type": "number", + "description": "The total amount of the order" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "channel": { + "$ref": "#/channels/user" + }, + "bindings": { + "$ref": "#/components/operationBindings/sendUser" + }, + "traits": [ + { + "$ref": "#/components/operationTraits/binding" + } + ], + "reply": { + "$ref": "#/components/replies/signupReply" + } + } + }, + "replies": { + "signupReply": { + "address": { + "$ref": "#/components/replyAddresses/signupReply" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + } + } + }, + "replyAddresses": { + "signupReply": { + "location": "$message.header#/replyTo" + } + }, + "securitySchemes": { + "oauth": { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + }, + "operationTraits": { + "binding": { + "bindings": { + "amqp": { + "ack": false + } + } + }, + "kafka": { + "bindings": { + "kafka": { + "groupId": false + } + } + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + }, + "tags": { + "user": { + "name": "user", + "description": "User-related messages" + } + }, + "externalDocs": { + "infoDocs": { + "url": "https://example.com/docs", + "description": "Find more info here" + } + }, + "serverBindings": { + "devAmqp": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "channelBindings": { + "user": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + } + }, + "operationBindings": { + "sendUser": { + "amqp": { + "ack": false + } + } + }, + "messageBindings": { + "user": { + "amqp": { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + } + } + } +} \ No newline at end of file diff --git a/scripts/validation/updated-docs/Contact-Object.json b/scripts/validation/updated-docs/Contact-Object.json new file mode 100644 index 00000000..6d94699e --- /dev/null +++ b/scripts/validation/updated-docs/Contact-Object.json @@ -0,0 +1,694 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "AsyncAPI", + "version": "1.x.x", + "description": "This is a very good base doc, probably.", + "termsOfService": "https://asyncapi.org/terms/", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ], + "contact": { + "name": "API Support", + "url": "https://www.example.com/support", + "email": "support@example.com" + } + }, + "servers": { + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Production RabbitMQ broker (uses the `production` vhost).", + "title": "Production Server", + "summary": "Production environment server", + "security": [ + { + "type": "http", + "scheme": "bearer" + } + ], + "tags": [ + { + "name": "production", + "description": "Production environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the production server", + "url": "https://example.com/docs/production" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "staging": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Staging RabbitMQ broker (uses the `staging` vhost).", + "title": "Staging Server", + "summary": "Staging environment server", + "security": [ + { + "type": "apiKey", + "in": "user", + "description": "Provide your API key as the user and leave the password empty." + } + ], + "tags": [ + { + "name": "staging", + "description": "Staging environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the staging server", + "url": "https://example.com/docs/staging" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "rabbitmqInProd": { + "host": "{prod}.in.mycompany.com", + "protocol": "amqp", + "description": "Production server" + }, + "rabbitmqInStaging": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "Staging server" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + }, + "userCompletedOrder": { + "$ref": "#/components/messages/userCompletedOrder" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/servers/production" + } + ], + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + }, + "tags": [ + { + "name": "user", + "description": "User-related messages" + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + }, + "userSignup": { + "address": "users.signup", + "description": "Channel for user signups", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + }, + "userSignupReply": { + "address": "users.signup.reply", + "description": "Channel for user signup replies", + "messages": { + "userSignedUpReply": { + "summary": "User signup reply message", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + } + } + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/user" + }, + "security": [ + { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "messages": [ + { + "$ref": "#/channels/user/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "#/channels/userSignupReply/messages/userSignedUpReply" + } + ] + }, + "traits": [] + } + }, + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type": "record", + "name": "UserCreate", + "namespace": "com.example", + "fields": [ + { + "name": "id", + "type": "int" + }, + { + "name": "name", + "type": "string" + } + ] + } + }, + "userCreate": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the user" + }, + "name": { + "type": "string", + "description": "The name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "The email of the user" + } + }, + "required": [ + "id", + "name", + "email" + ] + }, + "signup": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the signup" + }, + "source": { + "type": "string", + "description": "The source of the signup" + } + }, + "required": [ + "timestamp", + "source" + ] + }, + "ComplexModel": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "zip": { + "type": "string" + } + } + }, + "ErrorModel": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } + } + }, + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "RabbitMQ broker", + "bindings": { + "$ref": "#/components/serverBindings/devAmqp" + }, + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + } + }, + "security": [ + { + "$ref": "#/components/securitySchemes/oauth" + } + ] + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider in this example of `mycompany.com`" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignUp" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/components/servers/development" + } + ], + "bindings": { + "$ref": "#/components/channelBindings/user" + }, + "tags": [ + { + "$ref": "#/components/tags/user" + } + ], + "externalDocs": { + "$ref": "#/components/externalDocs/infoDocs" + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "payload": { + "$ref": "#/components/schemas/Category" + }, + "correlationId": { + "$ref": "#/components/correlationIds/default" + }, + "bindings": { + "$ref": "#/components/messageBindings/user" + }, + "examples": [] + }, + "userSignedUp": { + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + }, + "userSignedUpReply": { + "name": "UserSignupReply", + "title": "User signup reply", + "summary": "User signup reply message", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + }, + "userCompletedOrder": { + "summary": "User completed order event", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The ID of the order" + }, + "userId": { + "type": "string", + "description": "The ID of the user" + }, + "amount": { + "type": "number", + "description": "The total amount of the order" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "channel": { + "$ref": "#/channels/user" + }, + "bindings": { + "$ref": "#/components/operationBindings/sendUser" + }, + "traits": [ + { + "$ref": "#/components/operationTraits/binding" + } + ], + "reply": { + "$ref": "#/components/replies/signupReply" + } + } + }, + "replies": { + "signupReply": { + "address": { + "$ref": "#/components/replyAddresses/signupReply" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + } + } + }, + "replyAddresses": { + "signupReply": { + "location": "$message.header#/replyTo" + } + }, + "securitySchemes": { + "oauth": { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + }, + "operationTraits": { + "binding": { + "bindings": { + "amqp": { + "ack": false + } + } + }, + "kafka": { + "bindings": { + "kafka": { + "groupId": false + } + } + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + }, + "tags": { + "user": { + "name": "user", + "description": "User-related messages" + } + }, + "externalDocs": { + "infoDocs": { + "url": "https://example.com/docs", + "description": "Find more info here" + } + }, + "serverBindings": { + "devAmqp": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "channelBindings": { + "user": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + } + }, + "operationBindings": { + "sendUser": { + "amqp": { + "ack": false + } + } + }, + "messageBindings": { + "user": { + "amqp": { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + } + } + } +} \ No newline at end of file diff --git a/scripts/validation/updated-docs/Default-Content-Type-at-root-doc.json b/scripts/validation/updated-docs/Default-Content-Type-at-root-doc.json new file mode 100644 index 00000000..07f5ef5e --- /dev/null +++ b/scripts/validation/updated-docs/Default-Content-Type-at-root-doc.json @@ -0,0 +1,690 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "AsyncAPI", + "version": "1.x.x", + "description": "This is a very good base doc, probably.", + "termsOfService": "https://asyncapi.org/terms/", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ] + }, + "servers": { + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Production RabbitMQ broker (uses the `production` vhost).", + "title": "Production Server", + "summary": "Production environment server", + "security": [ + { + "type": "http", + "scheme": "bearer" + } + ], + "tags": [ + { + "name": "production", + "description": "Production environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the production server", + "url": "https://example.com/docs/production" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "staging": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Staging RabbitMQ broker (uses the `staging` vhost).", + "title": "Staging Server", + "summary": "Staging environment server", + "security": [ + { + "type": "apiKey", + "in": "user", + "description": "Provide your API key as the user and leave the password empty." + } + ], + "tags": [ + { + "name": "staging", + "description": "Staging environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the staging server", + "url": "https://example.com/docs/staging" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "rabbitmqInProd": { + "host": "{prod}.in.mycompany.com", + "protocol": "amqp", + "description": "Production server" + }, + "rabbitmqInStaging": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "Staging server" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + }, + "userCompletedOrder": { + "$ref": "#/components/messages/userCompletedOrder" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/servers/production" + } + ], + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + }, + "tags": [ + { + "name": "user", + "description": "User-related messages" + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + }, + "userSignup": { + "address": "users.signup", + "description": "Channel for user signups", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + }, + "userSignupReply": { + "address": "users.signup.reply", + "description": "Channel for user signup replies", + "messages": { + "userSignedUpReply": { + "summary": "User signup reply message", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + } + } + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/user" + }, + "security": [ + { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "messages": [ + { + "$ref": "#/channels/user/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "#/channels/userSignupReply/messages/userSignedUpReply" + } + ] + }, + "traits": [] + } + }, + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type": "record", + "name": "UserCreate", + "namespace": "com.example", + "fields": [ + { + "name": "id", + "type": "int" + }, + { + "name": "name", + "type": "string" + } + ] + } + }, + "userCreate": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the user" + }, + "name": { + "type": "string", + "description": "The name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "The email of the user" + } + }, + "required": [ + "id", + "name", + "email" + ] + }, + "signup": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the signup" + }, + "source": { + "type": "string", + "description": "The source of the signup" + } + }, + "required": [ + "timestamp", + "source" + ] + }, + "ComplexModel": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "zip": { + "type": "string" + } + } + }, + "ErrorModel": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } + } + }, + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "RabbitMQ broker", + "bindings": { + "$ref": "#/components/serverBindings/devAmqp" + }, + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + } + }, + "security": [ + { + "$ref": "#/components/securitySchemes/oauth" + } + ] + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider in this example of `mycompany.com`" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignUp" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/components/servers/development" + } + ], + "bindings": { + "$ref": "#/components/channelBindings/user" + }, + "tags": [ + { + "$ref": "#/components/tags/user" + } + ], + "externalDocs": { + "$ref": "#/components/externalDocs/infoDocs" + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "payload": { + "$ref": "#/components/schemas/Category" + }, + "correlationId": { + "$ref": "#/components/correlationIds/default" + }, + "bindings": { + "$ref": "#/components/messageBindings/user" + }, + "examples": [] + }, + "userSignedUp": { + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + }, + "userSignedUpReply": { + "name": "UserSignupReply", + "title": "User signup reply", + "summary": "User signup reply message", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + }, + "userCompletedOrder": { + "summary": "User completed order event", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The ID of the order" + }, + "userId": { + "type": "string", + "description": "The ID of the user" + }, + "amount": { + "type": "number", + "description": "The total amount of the order" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "channel": { + "$ref": "#/channels/user" + }, + "bindings": { + "$ref": "#/components/operationBindings/sendUser" + }, + "traits": [ + { + "$ref": "#/components/operationTraits/binding" + } + ], + "reply": { + "$ref": "#/components/replies/signupReply" + } + } + }, + "replies": { + "signupReply": { + "address": { + "$ref": "#/components/replyAddresses/signupReply" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + } + } + }, + "replyAddresses": { + "signupReply": { + "location": "$message.header#/replyTo" + } + }, + "securitySchemes": { + "oauth": { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + }, + "operationTraits": { + "binding": { + "bindings": { + "amqp": { + "ack": false + } + } + }, + "kafka": { + "bindings": { + "kafka": { + "groupId": false + } + } + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + }, + "tags": { + "user": { + "name": "user", + "description": "User-related messages" + } + }, + "externalDocs": { + "infoDocs": { + "url": "https://example.com/docs", + "description": "Find more info here" + } + }, + "serverBindings": { + "devAmqp": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "channelBindings": { + "user": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + } + }, + "operationBindings": { + "sendUser": { + "amqp": { + "ack": false + } + } + }, + "messageBindings": { + "user": { + "amqp": { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + } + } + }, + "defaultContentType": "application/json" +} \ No newline at end of file diff --git a/scripts/validation/updated-docs/External-Docs-Object.json b/scripts/validation/updated-docs/External-Docs-Object.json new file mode 100644 index 00000000..553e34c9 --- /dev/null +++ b/scripts/validation/updated-docs/External-Docs-Object.json @@ -0,0 +1,689 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "AsyncAPI", + "version": "1.x.x", + "description": "This is a very good base doc, probably.", + "termsOfService": "https://asyncapi.org/terms/", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ] + }, + "servers": { + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Production RabbitMQ broker (uses the `production` vhost).", + "title": "Production Server", + "summary": "Production environment server", + "security": [ + { + "type": "http", + "scheme": "bearer" + } + ], + "tags": [ + { + "name": "production", + "description": "Production environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the production server", + "url": "https://example.com/docs/production" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "staging": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Staging RabbitMQ broker (uses the `staging` vhost).", + "title": "Staging Server", + "summary": "Staging environment server", + "security": [ + { + "type": "apiKey", + "in": "user", + "description": "Provide your API key as the user and leave the password empty." + } + ], + "tags": [ + { + "name": "staging", + "description": "Staging environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the staging server", + "url": "https://example.com/docs/staging" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "rabbitmqInProd": { + "host": "{prod}.in.mycompany.com", + "protocol": "amqp", + "description": "Production server" + }, + "rabbitmqInStaging": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "Staging server" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + }, + "userCompletedOrder": { + "$ref": "#/components/messages/userCompletedOrder" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/servers/production" + } + ], + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + }, + "tags": [ + { + "name": "user", + "description": "User-related messages" + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + }, + "userSignup": { + "address": "users.signup", + "description": "Channel for user signups", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + }, + "userSignupReply": { + "address": "users.signup.reply", + "description": "Channel for user signup replies", + "messages": { + "userSignedUpReply": { + "summary": "User signup reply message", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + } + } + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/user" + }, + "security": [ + { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "messages": [ + { + "$ref": "#/channels/user/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "#/channels/userSignupReply/messages/userSignedUpReply" + } + ] + }, + "traits": [] + } + }, + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type": "record", + "name": "UserCreate", + "namespace": "com.example", + "fields": [ + { + "name": "id", + "type": "int" + }, + { + "name": "name", + "type": "string" + } + ] + } + }, + "userCreate": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the user" + }, + "name": { + "type": "string", + "description": "The name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "The email of the user" + } + }, + "required": [ + "id", + "name", + "email" + ] + }, + "signup": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the signup" + }, + "source": { + "type": "string", + "description": "The source of the signup" + } + }, + "required": [ + "timestamp", + "source" + ] + }, + "ComplexModel": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "zip": { + "type": "string" + } + } + }, + "ErrorModel": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } + } + }, + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "RabbitMQ broker", + "bindings": { + "$ref": "#/components/serverBindings/devAmqp" + }, + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + } + }, + "security": [ + { + "$ref": "#/components/securitySchemes/oauth" + } + ] + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider in this example of `mycompany.com`" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignUp" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/components/servers/development" + } + ], + "bindings": { + "$ref": "#/components/channelBindings/user" + }, + "tags": [ + { + "$ref": "#/components/tags/user" + } + ], + "externalDocs": { + "$ref": "#/components/externalDocs/infoDocs" + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "payload": { + "$ref": "#/components/schemas/Category" + }, + "correlationId": { + "$ref": "#/components/correlationIds/default" + }, + "bindings": { + "$ref": "#/components/messageBindings/user" + }, + "examples": [] + }, + "userSignedUp": { + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + }, + "userSignedUpReply": { + "name": "UserSignupReply", + "title": "User signup reply", + "summary": "User signup reply message", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + }, + "userCompletedOrder": { + "summary": "User completed order event", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The ID of the order" + }, + "userId": { + "type": "string", + "description": "The ID of the user" + }, + "amount": { + "type": "number", + "description": "The total amount of the order" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "channel": { + "$ref": "#/channels/user" + }, + "bindings": { + "$ref": "#/components/operationBindings/sendUser" + }, + "traits": [ + { + "$ref": "#/components/operationTraits/binding" + } + ], + "reply": { + "$ref": "#/components/replies/signupReply" + } + } + }, + "replies": { + "signupReply": { + "address": { + "$ref": "#/components/replyAddresses/signupReply" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + } + } + }, + "replyAddresses": { + "signupReply": { + "location": "$message.header#/replyTo" + } + }, + "securitySchemes": { + "oauth": { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + }, + "operationTraits": { + "binding": { + "bindings": { + "amqp": { + "ack": false + } + } + }, + "kafka": { + "bindings": { + "kafka": { + "groupId": false + } + } + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + }, + "tags": { + "user": { + "name": "user", + "description": "User-related messages" + } + }, + "externalDocs": { + "infoDocs": { + "url": "https://example.com", + "description": "Find more info here" + } + }, + "serverBindings": { + "devAmqp": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "channelBindings": { + "user": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + } + }, + "operationBindings": { + "sendUser": { + "amqp": { + "ack": false + } + } + }, + "messageBindings": { + "user": { + "amqp": { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + } + } + } +} \ No newline at end of file diff --git a/scripts/validation/updated-docs/Info-Object.json b/scripts/validation/updated-docs/Info-Object.json new file mode 100644 index 00000000..8fdd4ac8 --- /dev/null +++ b/scripts/validation/updated-docs/Info-Object.json @@ -0,0 +1,694 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "AsyncAPI Sample App", + "version": "1.0.1", + "description": "This is a sample app.", + "termsOfService": "https://asyncapi.org/terms/", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ], + "contact": { + "name": "API Support", + "url": "https://www.asyncapi.org/support", + "email": "support@asyncapi.org" + } + }, + "servers": { + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Production RabbitMQ broker (uses the `production` vhost).", + "title": "Production Server", + "summary": "Production environment server", + "security": [ + { + "type": "http", + "scheme": "bearer" + } + ], + "tags": [ + { + "name": "production", + "description": "Production environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the production server", + "url": "https://example.com/docs/production" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "staging": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Staging RabbitMQ broker (uses the `staging` vhost).", + "title": "Staging Server", + "summary": "Staging environment server", + "security": [ + { + "type": "apiKey", + "in": "user", + "description": "Provide your API key as the user and leave the password empty." + } + ], + "tags": [ + { + "name": "staging", + "description": "Staging environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the staging server", + "url": "https://example.com/docs/staging" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "rabbitmqInProd": { + "host": "{prod}.in.mycompany.com", + "protocol": "amqp", + "description": "Production server" + }, + "rabbitmqInStaging": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "Staging server" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + }, + "userCompletedOrder": { + "$ref": "#/components/messages/userCompletedOrder" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/servers/production" + } + ], + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + }, + "tags": [ + { + "name": "user", + "description": "User-related messages" + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + }, + "userSignup": { + "address": "users.signup", + "description": "Channel for user signups", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + }, + "userSignupReply": { + "address": "users.signup.reply", + "description": "Channel for user signup replies", + "messages": { + "userSignedUpReply": { + "summary": "User signup reply message", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + } + } + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/user" + }, + "security": [ + { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "messages": [ + { + "$ref": "#/channels/user/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "#/channels/userSignupReply/messages/userSignedUpReply" + } + ] + }, + "traits": [] + } + }, + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type": "record", + "name": "UserCreate", + "namespace": "com.example", + "fields": [ + { + "name": "id", + "type": "int" + }, + { + "name": "name", + "type": "string" + } + ] + } + }, + "userCreate": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the user" + }, + "name": { + "type": "string", + "description": "The name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "The email of the user" + } + }, + "required": [ + "id", + "name", + "email" + ] + }, + "signup": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the signup" + }, + "source": { + "type": "string", + "description": "The source of the signup" + } + }, + "required": [ + "timestamp", + "source" + ] + }, + "ComplexModel": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "zip": { + "type": "string" + } + } + }, + "ErrorModel": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } + } + }, + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "RabbitMQ broker", + "bindings": { + "$ref": "#/components/serverBindings/devAmqp" + }, + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + } + }, + "security": [ + { + "$ref": "#/components/securitySchemes/oauth" + } + ] + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider in this example of `mycompany.com`" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignUp" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/components/servers/development" + } + ], + "bindings": { + "$ref": "#/components/channelBindings/user" + }, + "tags": [ + { + "$ref": "#/components/tags/user" + } + ], + "externalDocs": { + "$ref": "#/components/externalDocs/infoDocs" + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "payload": { + "$ref": "#/components/schemas/Category" + }, + "correlationId": { + "$ref": "#/components/correlationIds/default" + }, + "bindings": { + "$ref": "#/components/messageBindings/user" + }, + "examples": [] + }, + "userSignedUp": { + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + }, + "userSignedUpReply": { + "name": "UserSignupReply", + "title": "User signup reply", + "summary": "User signup reply message", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + }, + "userCompletedOrder": { + "summary": "User completed order event", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The ID of the order" + }, + "userId": { + "type": "string", + "description": "The ID of the user" + }, + "amount": { + "type": "number", + "description": "The total amount of the order" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "channel": { + "$ref": "#/channels/user" + }, + "bindings": { + "$ref": "#/components/operationBindings/sendUser" + }, + "traits": [ + { + "$ref": "#/components/operationTraits/binding" + } + ], + "reply": { + "$ref": "#/components/replies/signupReply" + } + } + }, + "replies": { + "signupReply": { + "address": { + "$ref": "#/components/replyAddresses/signupReply" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + } + } + }, + "replyAddresses": { + "signupReply": { + "location": "$message.header#/replyTo" + } + }, + "securitySchemes": { + "oauth": { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + }, + "operationTraits": { + "binding": { + "bindings": { + "amqp": { + "ack": false + } + } + }, + "kafka": { + "bindings": { + "kafka": { + "groupId": false + } + } + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + }, + "tags": { + "user": { + "name": "user", + "description": "User-related messages" + } + }, + "externalDocs": { + "infoDocs": { + "url": "https://example.com/docs", + "description": "Find more info here" + } + }, + "serverBindings": { + "devAmqp": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "channelBindings": { + "user": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + } + }, + "operationBindings": { + "sendUser": { + "amqp": { + "ack": false + } + } + }, + "messageBindings": { + "user": { + "amqp": { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + } + } + } +} \ No newline at end of file diff --git a/scripts/validation/updated-docs/License-Object.json b/scripts/validation/updated-docs/License-Object.json new file mode 100644 index 00000000..0fecde4f --- /dev/null +++ b/scripts/validation/updated-docs/License-Object.json @@ -0,0 +1,689 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "AsyncAPI", + "version": "1.x.x", + "description": "This is a very good base doc, probably.", + "termsOfService": "https://asyncapi.org/terms/", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ] + }, + "servers": { + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Production RabbitMQ broker (uses the `production` vhost).", + "title": "Production Server", + "summary": "Production environment server", + "security": [ + { + "type": "http", + "scheme": "bearer" + } + ], + "tags": [ + { + "name": "production", + "description": "Production environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the production server", + "url": "https://example.com/docs/production" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "staging": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Staging RabbitMQ broker (uses the `staging` vhost).", + "title": "Staging Server", + "summary": "Staging environment server", + "security": [ + { + "type": "apiKey", + "in": "user", + "description": "Provide your API key as the user and leave the password empty." + } + ], + "tags": [ + { + "name": "staging", + "description": "Staging environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the staging server", + "url": "https://example.com/docs/staging" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "rabbitmqInProd": { + "host": "{prod}.in.mycompany.com", + "protocol": "amqp", + "description": "Production server" + }, + "rabbitmqInStaging": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "Staging server" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + }, + "userCompletedOrder": { + "$ref": "#/components/messages/userCompletedOrder" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/servers/production" + } + ], + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + }, + "tags": [ + { + "name": "user", + "description": "User-related messages" + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + }, + "userSignup": { + "address": "users.signup", + "description": "Channel for user signups", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + }, + "userSignupReply": { + "address": "users.signup.reply", + "description": "Channel for user signup replies", + "messages": { + "userSignedUpReply": { + "summary": "User signup reply message", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + } + } + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/user" + }, + "security": [ + { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "messages": [ + { + "$ref": "#/channels/user/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "#/channels/userSignupReply/messages/userSignedUpReply" + } + ] + }, + "traits": [] + } + }, + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type": "record", + "name": "UserCreate", + "namespace": "com.example", + "fields": [ + { + "name": "id", + "type": "int" + }, + { + "name": "name", + "type": "string" + } + ] + } + }, + "userCreate": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the user" + }, + "name": { + "type": "string", + "description": "The name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "The email of the user" + } + }, + "required": [ + "id", + "name", + "email" + ] + }, + "signup": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the signup" + }, + "source": { + "type": "string", + "description": "The source of the signup" + } + }, + "required": [ + "timestamp", + "source" + ] + }, + "ComplexModel": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "zip": { + "type": "string" + } + } + }, + "ErrorModel": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } + } + }, + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "RabbitMQ broker", + "bindings": { + "$ref": "#/components/serverBindings/devAmqp" + }, + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + } + }, + "security": [ + { + "$ref": "#/components/securitySchemes/oauth" + } + ] + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider in this example of `mycompany.com`" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignUp" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/components/servers/development" + } + ], + "bindings": { + "$ref": "#/components/channelBindings/user" + }, + "tags": [ + { + "$ref": "#/components/tags/user" + } + ], + "externalDocs": { + "$ref": "#/components/externalDocs/infoDocs" + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "payload": { + "$ref": "#/components/schemas/Category" + }, + "correlationId": { + "$ref": "#/components/correlationIds/default" + }, + "bindings": { + "$ref": "#/components/messageBindings/user" + }, + "examples": [] + }, + "userSignedUp": { + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + }, + "userSignedUpReply": { + "name": "UserSignupReply", + "title": "User signup reply", + "summary": "User signup reply message", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + }, + "userCompletedOrder": { + "summary": "User completed order event", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The ID of the order" + }, + "userId": { + "type": "string", + "description": "The ID of the user" + }, + "amount": { + "type": "number", + "description": "The total amount of the order" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "channel": { + "$ref": "#/channels/user" + }, + "bindings": { + "$ref": "#/components/operationBindings/sendUser" + }, + "traits": [ + { + "$ref": "#/components/operationTraits/binding" + } + ], + "reply": { + "$ref": "#/components/replies/signupReply" + } + } + }, + "replies": { + "signupReply": { + "address": { + "$ref": "#/components/replyAddresses/signupReply" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + } + } + }, + "replyAddresses": { + "signupReply": { + "location": "$message.header#/replyTo" + } + }, + "securitySchemes": { + "oauth": { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + }, + "operationTraits": { + "binding": { + "bindings": { + "amqp": { + "ack": false + } + } + }, + "kafka": { + "bindings": { + "kafka": { + "groupId": false + } + } + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + }, + "tags": { + "user": { + "name": "user", + "description": "User-related messages" + } + }, + "externalDocs": { + "infoDocs": { + "url": "https://example.com/docs", + "description": "Find more info here" + } + }, + "serverBindings": { + "devAmqp": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "channelBindings": { + "user": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + } + }, + "operationBindings": { + "sendUser": { + "amqp": { + "ack": false + } + } + }, + "messageBindings": { + "user": { + "amqp": { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + } + } + } +} \ No newline at end of file diff --git a/scripts/validation/updated-docs/Message-Correlation-ID-Object.json b/scripts/validation/updated-docs/Message-Correlation-ID-Object.json new file mode 100644 index 00000000..0fecde4f --- /dev/null +++ b/scripts/validation/updated-docs/Message-Correlation-ID-Object.json @@ -0,0 +1,689 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "AsyncAPI", + "version": "1.x.x", + "description": "This is a very good base doc, probably.", + "termsOfService": "https://asyncapi.org/terms/", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ] + }, + "servers": { + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Production RabbitMQ broker (uses the `production` vhost).", + "title": "Production Server", + "summary": "Production environment server", + "security": [ + { + "type": "http", + "scheme": "bearer" + } + ], + "tags": [ + { + "name": "production", + "description": "Production environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the production server", + "url": "https://example.com/docs/production" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "staging": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Staging RabbitMQ broker (uses the `staging` vhost).", + "title": "Staging Server", + "summary": "Staging environment server", + "security": [ + { + "type": "apiKey", + "in": "user", + "description": "Provide your API key as the user and leave the password empty." + } + ], + "tags": [ + { + "name": "staging", + "description": "Staging environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the staging server", + "url": "https://example.com/docs/staging" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "rabbitmqInProd": { + "host": "{prod}.in.mycompany.com", + "protocol": "amqp", + "description": "Production server" + }, + "rabbitmqInStaging": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "Staging server" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + }, + "userCompletedOrder": { + "$ref": "#/components/messages/userCompletedOrder" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/servers/production" + } + ], + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + }, + "tags": [ + { + "name": "user", + "description": "User-related messages" + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + }, + "userSignup": { + "address": "users.signup", + "description": "Channel for user signups", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + }, + "userSignupReply": { + "address": "users.signup.reply", + "description": "Channel for user signup replies", + "messages": { + "userSignedUpReply": { + "summary": "User signup reply message", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + } + } + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/user" + }, + "security": [ + { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "messages": [ + { + "$ref": "#/channels/user/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "#/channels/userSignupReply/messages/userSignedUpReply" + } + ] + }, + "traits": [] + } + }, + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type": "record", + "name": "UserCreate", + "namespace": "com.example", + "fields": [ + { + "name": "id", + "type": "int" + }, + { + "name": "name", + "type": "string" + } + ] + } + }, + "userCreate": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the user" + }, + "name": { + "type": "string", + "description": "The name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "The email of the user" + } + }, + "required": [ + "id", + "name", + "email" + ] + }, + "signup": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the signup" + }, + "source": { + "type": "string", + "description": "The source of the signup" + } + }, + "required": [ + "timestamp", + "source" + ] + }, + "ComplexModel": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "zip": { + "type": "string" + } + } + }, + "ErrorModel": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } + } + }, + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "RabbitMQ broker", + "bindings": { + "$ref": "#/components/serverBindings/devAmqp" + }, + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + } + }, + "security": [ + { + "$ref": "#/components/securitySchemes/oauth" + } + ] + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider in this example of `mycompany.com`" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignUp" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/components/servers/development" + } + ], + "bindings": { + "$ref": "#/components/channelBindings/user" + }, + "tags": [ + { + "$ref": "#/components/tags/user" + } + ], + "externalDocs": { + "$ref": "#/components/externalDocs/infoDocs" + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "payload": { + "$ref": "#/components/schemas/Category" + }, + "correlationId": { + "$ref": "#/components/correlationIds/default" + }, + "bindings": { + "$ref": "#/components/messageBindings/user" + }, + "examples": [] + }, + "userSignedUp": { + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + }, + "userSignedUpReply": { + "name": "UserSignupReply", + "title": "User signup reply", + "summary": "User signup reply message", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + }, + "userCompletedOrder": { + "summary": "User completed order event", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The ID of the order" + }, + "userId": { + "type": "string", + "description": "The ID of the user" + }, + "amount": { + "type": "number", + "description": "The total amount of the order" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "channel": { + "$ref": "#/channels/user" + }, + "bindings": { + "$ref": "#/components/operationBindings/sendUser" + }, + "traits": [ + { + "$ref": "#/components/operationTraits/binding" + } + ], + "reply": { + "$ref": "#/components/replies/signupReply" + } + } + }, + "replies": { + "signupReply": { + "address": { + "$ref": "#/components/replyAddresses/signupReply" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + } + } + }, + "replyAddresses": { + "signupReply": { + "location": "$message.header#/replyTo" + } + }, + "securitySchemes": { + "oauth": { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + }, + "operationTraits": { + "binding": { + "bindings": { + "amqp": { + "ack": false + } + } + }, + "kafka": { + "bindings": { + "kafka": { + "groupId": false + } + } + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + }, + "tags": { + "user": { + "name": "user", + "description": "User-related messages" + } + }, + "externalDocs": { + "infoDocs": { + "url": "https://example.com/docs", + "description": "Find more info here" + } + }, + "serverBindings": { + "devAmqp": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "channelBindings": { + "user": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + } + }, + "operationBindings": { + "sendUser": { + "amqp": { + "ack": false + } + } + }, + "messageBindings": { + "user": { + "amqp": { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + } + } + } +} \ No newline at end of file diff --git a/scripts/validation/updated-docs/Message-Example-Object.json b/scripts/validation/updated-docs/Message-Example-Object.json new file mode 100644 index 00000000..ed7ff974 --- /dev/null +++ b/scripts/validation/updated-docs/Message-Example-Object.json @@ -0,0 +1,706 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "AsyncAPI", + "version": "1.x.x", + "description": "This is a very good base doc, probably.", + "termsOfService": "https://asyncapi.org/terms/", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ] + }, + "servers": { + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Production RabbitMQ broker (uses the `production` vhost).", + "title": "Production Server", + "summary": "Production environment server", + "security": [ + { + "type": "http", + "scheme": "bearer" + } + ], + "tags": [ + { + "name": "production", + "description": "Production environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the production server", + "url": "https://example.com/docs/production" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "staging": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Staging RabbitMQ broker (uses the `staging` vhost).", + "title": "Staging Server", + "summary": "Staging environment server", + "security": [ + { + "type": "apiKey", + "in": "user", + "description": "Provide your API key as the user and leave the password empty." + } + ], + "tags": [ + { + "name": "staging", + "description": "Staging environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the staging server", + "url": "https://example.com/docs/staging" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "rabbitmqInProd": { + "host": "{prod}.in.mycompany.com", + "protocol": "amqp", + "description": "Production server" + }, + "rabbitmqInStaging": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "Staging server" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + }, + "userCompletedOrder": { + "$ref": "#/components/messages/userCompletedOrder" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/servers/production" + } + ], + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + }, + "tags": [ + { + "name": "user", + "description": "User-related messages" + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + }, + "userSignup": { + "address": "users.signup", + "description": "Channel for user signups", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + }, + "userSignupReply": { + "address": "users.signup.reply", + "description": "Channel for user signup replies", + "messages": { + "userSignedUpReply": { + "summary": "User signup reply message", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + } + } + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/user" + }, + "security": [ + { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "messages": [ + { + "$ref": "#/channels/user/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "#/channels/userSignupReply/messages/userSignedUpReply" + } + ] + }, + "traits": [] + } + }, + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type": "record", + "name": "UserCreate", + "namespace": "com.example", + "fields": [ + { + "name": "id", + "type": "int" + }, + { + "name": "name", + "type": "string" + } + ] + } + }, + "userCreate": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the user" + }, + "name": { + "type": "string", + "description": "The name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "The email of the user" + } + }, + "required": [ + "id", + "name", + "email" + ] + }, + "signup": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the signup" + }, + "source": { + "type": "string", + "description": "The source of the signup" + } + }, + "required": [ + "timestamp", + "source" + ] + }, + "ComplexModel": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "zip": { + "type": "string" + } + } + }, + "ErrorModel": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } + } + }, + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "RabbitMQ broker", + "bindings": { + "$ref": "#/components/serverBindings/devAmqp" + }, + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + } + }, + "security": [ + { + "$ref": "#/components/securitySchemes/oauth" + } + ] + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider in this example of `mycompany.com`" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignUp" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/components/servers/development" + } + ], + "bindings": { + "$ref": "#/components/channelBindings/user" + }, + "tags": [ + { + "$ref": "#/components/tags/user" + } + ], + "externalDocs": { + "$ref": "#/components/externalDocs/infoDocs" + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "payload": { + "$ref": "#/components/schemas/Category" + }, + "correlationId": { + "$ref": "#/components/correlationIds/default" + }, + "bindings": { + "$ref": "#/components/messageBindings/user" + }, + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + }, + "userSignedUp": { + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + }, + "userSignedUpReply": { + "name": "UserSignupReply", + "title": "User signup reply", + "summary": "User signup reply message", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + }, + "userCompletedOrder": { + "summary": "User completed order event", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The ID of the order" + }, + "userId": { + "type": "string", + "description": "The ID of the user" + }, + "amount": { + "type": "number", + "description": "The total amount of the order" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "channel": { + "$ref": "#/channels/user" + }, + "bindings": { + "$ref": "#/components/operationBindings/sendUser" + }, + "traits": [ + { + "$ref": "#/components/operationTraits/binding" + } + ], + "reply": { + "$ref": "#/components/replies/signupReply" + } + } + }, + "replies": { + "signupReply": { + "address": { + "$ref": "#/components/replyAddresses/signupReply" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + } + } + }, + "replyAddresses": { + "signupReply": { + "location": "$message.header#/replyTo" + } + }, + "securitySchemes": { + "oauth": { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + }, + "operationTraits": { + "binding": { + "bindings": { + "amqp": { + "ack": false + } + } + }, + "kafka": { + "bindings": { + "kafka": { + "groupId": false + } + } + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + }, + "tags": { + "user": { + "name": "user", + "description": "User-related messages" + } + }, + "externalDocs": { + "infoDocs": { + "url": "https://example.com/docs", + "description": "Find more info here" + } + }, + "serverBindings": { + "devAmqp": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "channelBindings": { + "user": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + } + }, + "operationBindings": { + "sendUser": { + "amqp": { + "ack": false + } + } + }, + "messageBindings": { + "user": { + "amqp": { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + } + } + } +} \ No newline at end of file diff --git a/scripts/validation/updated-docs/Message-Object.json b/scripts/validation/updated-docs/Message-Object.json new file mode 100644 index 00000000..68fb56b4 --- /dev/null +++ b/scripts/validation/updated-docs/Message-Object.json @@ -0,0 +1,693 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "AsyncAPI", + "version": "1.x.x", + "description": "This is a very good base doc, probably.", + "termsOfService": "https://asyncapi.org/terms/", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ] + }, + "servers": { + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Production RabbitMQ broker (uses the `production` vhost).", + "title": "Production Server", + "summary": "Production environment server", + "security": [ + { + "type": "http", + "scheme": "bearer" + } + ], + "tags": [ + { + "name": "production", + "description": "Production environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the production server", + "url": "https://example.com/docs/production" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "staging": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Staging RabbitMQ broker (uses the `staging` vhost).", + "title": "Staging Server", + "summary": "Staging environment server", + "security": [ + { + "type": "apiKey", + "in": "user", + "description": "Provide your API key as the user and leave the password empty." + } + ], + "tags": [ + { + "name": "staging", + "description": "Staging environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the staging server", + "url": "https://example.com/docs/staging" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "rabbitmqInProd": { + "host": "{prod}.in.mycompany.com", + "protocol": "amqp", + "description": "Production server" + }, + "rabbitmqInStaging": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "Staging server" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + }, + "userCompletedOrder": { + "$ref": "#/components/messages/userCompletedOrder" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/servers/production" + } + ], + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + }, + "tags": [ + { + "name": "user", + "description": "User-related messages" + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + }, + "userSignup": { + "address": "users.signup", + "description": "Channel for user signups", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + }, + "userSignupReply": { + "address": "users.signup.reply", + "description": "Channel for user signup replies", + "messages": { + "userSignedUpReply": { + "summary": "User signup reply message", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + } + } + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/user" + }, + "security": [ + { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "messages": [ + { + "$ref": "#/channels/user/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "#/channels/userSignupReply/messages/userSignedUpReply" + } + ] + }, + "traits": [] + } + }, + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type": "record", + "name": "UserCreate", + "namespace": "com.example", + "fields": [ + { + "name": "id", + "type": "int" + }, + { + "name": "name", + "type": "string" + } + ] + } + }, + "userCreate": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the user" + }, + "name": { + "type": "string", + "description": "The name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "The email of the user" + } + }, + "required": [ + "id", + "name", + "email" + ] + }, + "signup": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the signup" + }, + "source": { + "type": "string", + "description": "The source of the signup" + } + }, + "required": [ + "timestamp", + "source" + ] + }, + "ComplexModel": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "zip": { + "type": "string" + } + } + }, + "ErrorModel": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } + } + }, + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "RabbitMQ broker", + "bindings": { + "$ref": "#/components/serverBindings/devAmqp" + }, + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + } + }, + "security": [ + { + "$ref": "#/components/securitySchemes/oauth" + } + ] + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider in this example of `mycompany.com`" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignUp" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/components/servers/development" + } + ], + "bindings": { + "$ref": "#/components/channelBindings/user" + }, + "tags": [ + { + "$ref": "#/components/tags/user" + } + ], + "externalDocs": { + "$ref": "#/components/externalDocs/infoDocs" + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "payload": { + "$ref": "#/components/schemas/Category" + }, + "correlationId": { + "$ref": "#/components/correlationIds/default" + }, + "bindings": { + "$ref": "#/components/messageBindings/user" + }, + "examples": [] + }, + "userSignedUp": { + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + }, + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "$ref": "path/to/user-create.avsc#/UserCreate" + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + }, + "userSignedUpReply": { + "name": "UserSignupReply", + "title": "User signup reply", + "summary": "User signup reply message", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + }, + "userCompletedOrder": { + "summary": "User completed order event", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The ID of the order" + }, + "userId": { + "type": "string", + "description": "The ID of the user" + }, + "amount": { + "type": "number", + "description": "The total amount of the order" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "channel": { + "$ref": "#/channels/user" + }, + "bindings": { + "$ref": "#/components/operationBindings/sendUser" + }, + "traits": [ + { + "$ref": "#/components/operationTraits/binding" + } + ], + "reply": { + "$ref": "#/components/replies/signupReply" + } + } + }, + "replies": { + "signupReply": { + "address": { + "$ref": "#/components/replyAddresses/signupReply" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + } + } + }, + "replyAddresses": { + "signupReply": { + "location": "$message.header#/replyTo" + } + }, + "securitySchemes": { + "oauth": { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + }, + "operationTraits": { + "binding": { + "bindings": { + "amqp": { + "ack": false + } + } + }, + "kafka": { + "bindings": { + "kafka": { + "groupId": false + } + } + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + }, + "tags": { + "user": { + "name": "user", + "description": "User-related messages" + } + }, + "externalDocs": { + "infoDocs": { + "url": "https://example.com/docs", + "description": "Find more info here" + } + }, + "serverBindings": { + "devAmqp": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "channelBindings": { + "user": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + } + }, + "operationBindings": { + "sendUser": { + "amqp": { + "ack": false + } + } + }, + "messageBindings": { + "user": { + "amqp": { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + } + } + } +} \ No newline at end of file diff --git a/scripts/validation/updated-docs/Message-Trait-Object.json b/scripts/validation/updated-docs/Message-Trait-Object.json new file mode 100644 index 00000000..ae0708be --- /dev/null +++ b/scripts/validation/updated-docs/Message-Trait-Object.json @@ -0,0 +1,690 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "AsyncAPI", + "version": "1.x.x", + "description": "This is a very good base doc, probably.", + "termsOfService": "https://asyncapi.org/terms/", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ] + }, + "servers": { + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Production RabbitMQ broker (uses the `production` vhost).", + "title": "Production Server", + "summary": "Production environment server", + "security": [ + { + "type": "http", + "scheme": "bearer" + } + ], + "tags": [ + { + "name": "production", + "description": "Production environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the production server", + "url": "https://example.com/docs/production" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "staging": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Staging RabbitMQ broker (uses the `staging` vhost).", + "title": "Staging Server", + "summary": "Staging environment server", + "security": [ + { + "type": "apiKey", + "in": "user", + "description": "Provide your API key as the user and leave the password empty." + } + ], + "tags": [ + { + "name": "staging", + "description": "Staging environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the staging server", + "url": "https://example.com/docs/staging" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "rabbitmqInProd": { + "host": "{prod}.in.mycompany.com", + "protocol": "amqp", + "description": "Production server" + }, + "rabbitmqInStaging": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "Staging server" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + }, + "userCompletedOrder": { + "$ref": "#/components/messages/userCompletedOrder" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/servers/production" + } + ], + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + }, + "tags": [ + { + "name": "user", + "description": "User-related messages" + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + }, + "userSignup": { + "address": "users.signup", + "description": "Channel for user signups", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + }, + "userSignupReply": { + "address": "users.signup.reply", + "description": "Channel for user signup replies", + "messages": { + "userSignedUpReply": { + "summary": "User signup reply message", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + } + } + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/user" + }, + "security": [ + { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "messages": [ + { + "$ref": "#/channels/user/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "#/channels/userSignupReply/messages/userSignedUpReply" + } + ] + }, + "traits": [] + } + }, + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type": "record", + "name": "UserCreate", + "namespace": "com.example", + "fields": [ + { + "name": "id", + "type": "int" + }, + { + "name": "name", + "type": "string" + } + ] + } + }, + "userCreate": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the user" + }, + "name": { + "type": "string", + "description": "The name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "The email of the user" + } + }, + "required": [ + "id", + "name", + "email" + ] + }, + "signup": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the signup" + }, + "source": { + "type": "string", + "description": "The source of the signup" + } + }, + "required": [ + "timestamp", + "source" + ] + }, + "ComplexModel": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "zip": { + "type": "string" + } + } + }, + "ErrorModel": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } + } + }, + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "RabbitMQ broker", + "bindings": { + "$ref": "#/components/serverBindings/devAmqp" + }, + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + } + }, + "security": [ + { + "$ref": "#/components/securitySchemes/oauth" + } + ] + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider in this example of `mycompany.com`" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignUp" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/components/servers/development" + } + ], + "bindings": { + "$ref": "#/components/channelBindings/user" + }, + "tags": [ + { + "$ref": "#/components/tags/user" + } + ], + "externalDocs": { + "$ref": "#/components/externalDocs/infoDocs" + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "payload": { + "$ref": "#/components/schemas/Category" + }, + "correlationId": { + "$ref": "#/components/correlationIds/default" + }, + "bindings": { + "$ref": "#/components/messageBindings/user" + }, + "examples": [] + }, + "userSignedUp": { + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + }, + "userSignedUpReply": { + "name": "UserSignupReply", + "title": "User signup reply", + "summary": "User signup reply message", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + }, + "userCompletedOrder": { + "summary": "User completed order event", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The ID of the order" + }, + "userId": { + "type": "string", + "description": "The ID of the user" + }, + "amount": { + "type": "number", + "description": "The total amount of the order" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "channel": { + "$ref": "#/channels/user" + }, + "bindings": { + "$ref": "#/components/operationBindings/sendUser" + }, + "traits": [ + { + "$ref": "#/components/operationTraits/binding" + } + ], + "reply": { + "$ref": "#/components/replies/signupReply" + } + } + }, + "replies": { + "signupReply": { + "address": { + "$ref": "#/components/replyAddresses/signupReply" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + } + } + }, + "replyAddresses": { + "signupReply": { + "location": "$message.header#/replyTo" + } + }, + "securitySchemes": { + "oauth": { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + }, + "operationTraits": { + "binding": { + "bindings": { + "amqp": { + "ack": false + } + } + }, + "kafka": { + "bindings": { + "kafka": { + "groupId": false + } + } + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + }, + "contentType": "application/json" + } + }, + "tags": { + "user": { + "name": "user", + "description": "User-related messages" + } + }, + "externalDocs": { + "infoDocs": { + "url": "https://example.com/docs", + "description": "Find more info here" + } + }, + "serverBindings": { + "devAmqp": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "channelBindings": { + "user": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + } + }, + "operationBindings": { + "sendUser": { + "amqp": { + "ack": false + } + } + }, + "messageBindings": { + "user": { + "amqp": { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + } + } + } +} \ No newline at end of file diff --git a/scripts/validation/updated-docs/Messages-Object.json b/scripts/validation/updated-docs/Messages-Object.json new file mode 100644 index 00000000..0fecde4f --- /dev/null +++ b/scripts/validation/updated-docs/Messages-Object.json @@ -0,0 +1,689 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "AsyncAPI", + "version": "1.x.x", + "description": "This is a very good base doc, probably.", + "termsOfService": "https://asyncapi.org/terms/", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ] + }, + "servers": { + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Production RabbitMQ broker (uses the `production` vhost).", + "title": "Production Server", + "summary": "Production environment server", + "security": [ + { + "type": "http", + "scheme": "bearer" + } + ], + "tags": [ + { + "name": "production", + "description": "Production environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the production server", + "url": "https://example.com/docs/production" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "staging": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Staging RabbitMQ broker (uses the `staging` vhost).", + "title": "Staging Server", + "summary": "Staging environment server", + "security": [ + { + "type": "apiKey", + "in": "user", + "description": "Provide your API key as the user and leave the password empty." + } + ], + "tags": [ + { + "name": "staging", + "description": "Staging environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the staging server", + "url": "https://example.com/docs/staging" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "rabbitmqInProd": { + "host": "{prod}.in.mycompany.com", + "protocol": "amqp", + "description": "Production server" + }, + "rabbitmqInStaging": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "Staging server" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + }, + "userCompletedOrder": { + "$ref": "#/components/messages/userCompletedOrder" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/servers/production" + } + ], + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + }, + "tags": [ + { + "name": "user", + "description": "User-related messages" + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + }, + "userSignup": { + "address": "users.signup", + "description": "Channel for user signups", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + }, + "userSignupReply": { + "address": "users.signup.reply", + "description": "Channel for user signup replies", + "messages": { + "userSignedUpReply": { + "summary": "User signup reply message", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + } + } + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/user" + }, + "security": [ + { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "messages": [ + { + "$ref": "#/channels/user/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "#/channels/userSignupReply/messages/userSignedUpReply" + } + ] + }, + "traits": [] + } + }, + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type": "record", + "name": "UserCreate", + "namespace": "com.example", + "fields": [ + { + "name": "id", + "type": "int" + }, + { + "name": "name", + "type": "string" + } + ] + } + }, + "userCreate": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the user" + }, + "name": { + "type": "string", + "description": "The name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "The email of the user" + } + }, + "required": [ + "id", + "name", + "email" + ] + }, + "signup": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the signup" + }, + "source": { + "type": "string", + "description": "The source of the signup" + } + }, + "required": [ + "timestamp", + "source" + ] + }, + "ComplexModel": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "zip": { + "type": "string" + } + } + }, + "ErrorModel": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } + } + }, + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "RabbitMQ broker", + "bindings": { + "$ref": "#/components/serverBindings/devAmqp" + }, + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + } + }, + "security": [ + { + "$ref": "#/components/securitySchemes/oauth" + } + ] + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider in this example of `mycompany.com`" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignUp" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/components/servers/development" + } + ], + "bindings": { + "$ref": "#/components/channelBindings/user" + }, + "tags": [ + { + "$ref": "#/components/tags/user" + } + ], + "externalDocs": { + "$ref": "#/components/externalDocs/infoDocs" + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "payload": { + "$ref": "#/components/schemas/Category" + }, + "correlationId": { + "$ref": "#/components/correlationIds/default" + }, + "bindings": { + "$ref": "#/components/messageBindings/user" + }, + "examples": [] + }, + "userSignedUp": { + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + }, + "userSignedUpReply": { + "name": "UserSignupReply", + "title": "User signup reply", + "summary": "User signup reply message", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + }, + "userCompletedOrder": { + "summary": "User completed order event", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The ID of the order" + }, + "userId": { + "type": "string", + "description": "The ID of the user" + }, + "amount": { + "type": "number", + "description": "The total amount of the order" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "channel": { + "$ref": "#/channels/user" + }, + "bindings": { + "$ref": "#/components/operationBindings/sendUser" + }, + "traits": [ + { + "$ref": "#/components/operationTraits/binding" + } + ], + "reply": { + "$ref": "#/components/replies/signupReply" + } + } + }, + "replies": { + "signupReply": { + "address": { + "$ref": "#/components/replyAddresses/signupReply" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + } + } + }, + "replyAddresses": { + "signupReply": { + "location": "$message.header#/replyTo" + } + }, + "securitySchemes": { + "oauth": { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + }, + "operationTraits": { + "binding": { + "bindings": { + "amqp": { + "ack": false + } + } + }, + "kafka": { + "bindings": { + "kafka": { + "groupId": false + } + } + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + }, + "tags": { + "user": { + "name": "user", + "description": "User-related messages" + } + }, + "externalDocs": { + "infoDocs": { + "url": "https://example.com/docs", + "description": "Find more info here" + } + }, + "serverBindings": { + "devAmqp": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "channelBindings": { + "user": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + } + }, + "operationBindings": { + "sendUser": { + "amqp": { + "ack": false + } + } + }, + "messageBindings": { + "user": { + "amqp": { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + } + } + } +} \ No newline at end of file diff --git a/scripts/validation/updated-docs/Operation-Object.json b/scripts/validation/updated-docs/Operation-Object.json new file mode 100644 index 00000000..28120000 --- /dev/null +++ b/scripts/validation/updated-docs/Operation-Object.json @@ -0,0 +1,697 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "AsyncAPI", + "version": "1.x.x", + "description": "This is a very good base doc, probably.", + "termsOfService": "https://asyncapi.org/terms/", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ] + }, + "servers": { + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Production RabbitMQ broker (uses the `production` vhost).", + "title": "Production Server", + "summary": "Production environment server", + "security": [ + { + "type": "http", + "scheme": "bearer" + } + ], + "tags": [ + { + "name": "production", + "description": "Production environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the production server", + "url": "https://example.com/docs/production" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "staging": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Staging RabbitMQ broker (uses the `staging` vhost).", + "title": "Staging Server", + "summary": "Staging environment server", + "security": [ + { + "type": "apiKey", + "in": "user", + "description": "Provide your API key as the user and leave the password empty." + } + ], + "tags": [ + { + "name": "staging", + "description": "Staging environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the staging server", + "url": "https://example.com/docs/staging" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "rabbitmqInProd": { + "host": "{prod}.in.mycompany.com", + "protocol": "amqp", + "description": "Production server" + }, + "rabbitmqInStaging": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "Staging server" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + }, + "userCompletedOrder": { + "$ref": "#/components/messages/userCompletedOrder" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/servers/production" + } + ], + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + }, + "tags": [ + { + "name": "user", + "description": "User-related messages" + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + }, + "userSignup": { + "address": "users.signup", + "description": "Channel for user signups", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + }, + "userSignupReply": { + "address": "users.signup.reply", + "description": "Channel for user signup replies", + "messages": { + "userSignedUpReply": { + "summary": "User signup reply message", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + } + } + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/userSignup" + }, + "security": [ + { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ], + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "messages": [ + { + "$ref": "/components/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "/components/messages/userSignedUpReply" + } + ] + }, + "traits": [ + { + "$ref": "#/components/operationTraits/kafka" + } + ] + } + }, + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type": "record", + "name": "UserCreate", + "namespace": "com.example", + "fields": [ + { + "name": "id", + "type": "int" + }, + { + "name": "name", + "type": "string" + } + ] + } + }, + "userCreate": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the user" + }, + "name": { + "type": "string", + "description": "The name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "The email of the user" + } + }, + "required": [ + "id", + "name", + "email" + ] + }, + "signup": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the signup" + }, + "source": { + "type": "string", + "description": "The source of the signup" + } + }, + "required": [ + "timestamp", + "source" + ] + }, + "ComplexModel": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "zip": { + "type": "string" + } + } + }, + "ErrorModel": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } + } + }, + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "RabbitMQ broker", + "bindings": { + "$ref": "#/components/serverBindings/devAmqp" + }, + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + } + }, + "security": [ + { + "$ref": "#/components/securitySchemes/oauth" + } + ] + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider in this example of `mycompany.com`" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignUp" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/components/servers/development" + } + ], + "bindings": { + "$ref": "#/components/channelBindings/user" + }, + "tags": [ + { + "$ref": "#/components/tags/user" + } + ], + "externalDocs": { + "$ref": "#/components/externalDocs/infoDocs" + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "payload": { + "$ref": "#/components/schemas/Category" + }, + "correlationId": { + "$ref": "#/components/correlationIds/default" + }, + "bindings": { + "$ref": "#/components/messageBindings/user" + }, + "examples": [] + }, + "userSignedUp": { + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + }, + "userSignedUpReply": { + "name": "UserSignupReply", + "title": "User signup reply", + "summary": "User signup reply message", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + }, + "userCompletedOrder": { + "summary": "User completed order event", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The ID of the order" + }, + "userId": { + "type": "string", + "description": "The ID of the user" + }, + "amount": { + "type": "number", + "description": "The total amount of the order" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "channel": { + "$ref": "#/channels/user" + }, + "bindings": { + "$ref": "#/components/operationBindings/sendUser" + }, + "traits": [ + { + "$ref": "#/components/operationTraits/binding" + } + ], + "reply": { + "$ref": "#/components/replies/signupReply" + } + } + }, + "replies": { + "signupReply": { + "address": { + "$ref": "#/components/replyAddresses/signupReply" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + } + } + }, + "replyAddresses": { + "signupReply": { + "location": "$message.header#/replyTo" + } + }, + "securitySchemes": { + "oauth": { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + }, + "operationTraits": { + "binding": { + "bindings": { + "amqp": { + "ack": false + } + } + }, + "kafka": { + "bindings": { + "kafka": { + "groupId": false + } + } + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + }, + "tags": { + "user": { + "name": "user", + "description": "User-related messages" + } + }, + "externalDocs": { + "infoDocs": { + "url": "https://example.com/docs", + "description": "Find more info here" + } + }, + "serverBindings": { + "devAmqp": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "channelBindings": { + "user": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + } + }, + "operationBindings": { + "sendUser": { + "amqp": { + "ack": false + } + } + }, + "messageBindings": { + "user": { + "amqp": { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + } + } + } +} \ No newline at end of file diff --git a/scripts/validation/updated-docs/Operation-Reply-Address-Object.json b/scripts/validation/updated-docs/Operation-Reply-Address-Object.json new file mode 100644 index 00000000..74b52763 --- /dev/null +++ b/scripts/validation/updated-docs/Operation-Reply-Address-Object.json @@ -0,0 +1,690 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "AsyncAPI", + "version": "1.x.x", + "description": "This is a very good base doc, probably.", + "termsOfService": "https://asyncapi.org/terms/", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ] + }, + "servers": { + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Production RabbitMQ broker (uses the `production` vhost).", + "title": "Production Server", + "summary": "Production environment server", + "security": [ + { + "type": "http", + "scheme": "bearer" + } + ], + "tags": [ + { + "name": "production", + "description": "Production environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the production server", + "url": "https://example.com/docs/production" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "staging": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Staging RabbitMQ broker (uses the `staging` vhost).", + "title": "Staging Server", + "summary": "Staging environment server", + "security": [ + { + "type": "apiKey", + "in": "user", + "description": "Provide your API key as the user and leave the password empty." + } + ], + "tags": [ + { + "name": "staging", + "description": "Staging environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the staging server", + "url": "https://example.com/docs/staging" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "rabbitmqInProd": { + "host": "{prod}.in.mycompany.com", + "protocol": "amqp", + "description": "Production server" + }, + "rabbitmqInStaging": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "Staging server" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + }, + "userCompletedOrder": { + "$ref": "#/components/messages/userCompletedOrder" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/servers/production" + } + ], + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + }, + "tags": [ + { + "name": "user", + "description": "User-related messages" + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + }, + "userSignup": { + "address": "users.signup", + "description": "Channel for user signups", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + }, + "userSignupReply": { + "address": "users.signup.reply", + "description": "Channel for user signup replies", + "messages": { + "userSignedUpReply": { + "summary": "User signup reply message", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + } + } + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/user" + }, + "security": [ + { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "messages": [ + { + "$ref": "#/channels/user/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo", + "description": "Consumer inbox" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "#/channels/userSignupReply/messages/userSignedUpReply" + } + ] + }, + "traits": [] + } + }, + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type": "record", + "name": "UserCreate", + "namespace": "com.example", + "fields": [ + { + "name": "id", + "type": "int" + }, + { + "name": "name", + "type": "string" + } + ] + } + }, + "userCreate": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the user" + }, + "name": { + "type": "string", + "description": "The name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "The email of the user" + } + }, + "required": [ + "id", + "name", + "email" + ] + }, + "signup": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the signup" + }, + "source": { + "type": "string", + "description": "The source of the signup" + } + }, + "required": [ + "timestamp", + "source" + ] + }, + "ComplexModel": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "zip": { + "type": "string" + } + } + }, + "ErrorModel": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } + } + }, + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "RabbitMQ broker", + "bindings": { + "$ref": "#/components/serverBindings/devAmqp" + }, + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + } + }, + "security": [ + { + "$ref": "#/components/securitySchemes/oauth" + } + ] + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider in this example of `mycompany.com`" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignUp" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/components/servers/development" + } + ], + "bindings": { + "$ref": "#/components/channelBindings/user" + }, + "tags": [ + { + "$ref": "#/components/tags/user" + } + ], + "externalDocs": { + "$ref": "#/components/externalDocs/infoDocs" + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "payload": { + "$ref": "#/components/schemas/Category" + }, + "correlationId": { + "$ref": "#/components/correlationIds/default" + }, + "bindings": { + "$ref": "#/components/messageBindings/user" + }, + "examples": [] + }, + "userSignedUp": { + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + }, + "userSignedUpReply": { + "name": "UserSignupReply", + "title": "User signup reply", + "summary": "User signup reply message", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + }, + "userCompletedOrder": { + "summary": "User completed order event", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The ID of the order" + }, + "userId": { + "type": "string", + "description": "The ID of the user" + }, + "amount": { + "type": "number", + "description": "The total amount of the order" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "channel": { + "$ref": "#/channels/user" + }, + "bindings": { + "$ref": "#/components/operationBindings/sendUser" + }, + "traits": [ + { + "$ref": "#/components/operationTraits/binding" + } + ], + "reply": { + "$ref": "#/components/replies/signupReply" + } + } + }, + "replies": { + "signupReply": { + "address": { + "$ref": "#/components/replyAddresses/signupReply" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + } + } + }, + "replyAddresses": { + "signupReply": { + "location": "$message.header#/replyTo" + } + }, + "securitySchemes": { + "oauth": { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + }, + "operationTraits": { + "binding": { + "bindings": { + "amqp": { + "ack": false + } + } + }, + "kafka": { + "bindings": { + "kafka": { + "groupId": false + } + } + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + }, + "tags": { + "user": { + "name": "user", + "description": "User-related messages" + } + }, + "externalDocs": { + "infoDocs": { + "url": "https://example.com/docs", + "description": "Find more info here" + } + }, + "serverBindings": { + "devAmqp": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "channelBindings": { + "user": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + } + }, + "operationBindings": { + "sendUser": { + "amqp": { + "ack": false + } + } + }, + "messageBindings": { + "user": { + "amqp": { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + } + } + } +} \ No newline at end of file diff --git a/scripts/validation/updated-docs/Operation-Traits-Object.json b/scripts/validation/updated-docs/Operation-Traits-Object.json new file mode 100644 index 00000000..f71f5900 --- /dev/null +++ b/scripts/validation/updated-docs/Operation-Traits-Object.json @@ -0,0 +1,697 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "AsyncAPI", + "version": "1.x.x", + "description": "This is a very good base doc, probably.", + "termsOfService": "https://asyncapi.org/terms/", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ] + }, + "servers": { + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Production RabbitMQ broker (uses the `production` vhost).", + "title": "Production Server", + "summary": "Production environment server", + "security": [ + { + "type": "http", + "scheme": "bearer" + } + ], + "tags": [ + { + "name": "production", + "description": "Production environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the production server", + "url": "https://example.com/docs/production" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "staging": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Staging RabbitMQ broker (uses the `staging` vhost).", + "title": "Staging Server", + "summary": "Staging environment server", + "security": [ + { + "type": "apiKey", + "in": "user", + "description": "Provide your API key as the user and leave the password empty." + } + ], + "tags": [ + { + "name": "staging", + "description": "Staging environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the staging server", + "url": "https://example.com/docs/staging" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "rabbitmqInProd": { + "host": "{prod}.in.mycompany.com", + "protocol": "amqp", + "description": "Production server" + }, + "rabbitmqInStaging": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "Staging server" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + }, + "userCompletedOrder": { + "$ref": "#/components/messages/userCompletedOrder" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/servers/production" + } + ], + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + }, + "tags": [ + { + "name": "user", + "description": "User-related messages" + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + }, + "userSignup": { + "address": "users.signup", + "description": "Channel for user signups", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + }, + "userSignupReply": { + "address": "users.signup.reply", + "description": "Channel for user signup replies", + "messages": { + "userSignedUpReply": { + "summary": "User signup reply message", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + } + } + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/user" + }, + "security": [ + { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "messages": [ + { + "$ref": "#/channels/user/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "#/channels/userSignupReply/messages/userSignedUpReply" + } + ] + }, + "traits": [ + { + "bindings": { + "amqp": { + "ack": false + } + } + } + ] + } + }, + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type": "record", + "name": "UserCreate", + "namespace": "com.example", + "fields": [ + { + "name": "id", + "type": "int" + }, + { + "name": "name", + "type": "string" + } + ] + } + }, + "userCreate": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the user" + }, + "name": { + "type": "string", + "description": "The name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "The email of the user" + } + }, + "required": [ + "id", + "name", + "email" + ] + }, + "signup": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the signup" + }, + "source": { + "type": "string", + "description": "The source of the signup" + } + }, + "required": [ + "timestamp", + "source" + ] + }, + "ComplexModel": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "zip": { + "type": "string" + } + } + }, + "ErrorModel": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } + } + }, + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "RabbitMQ broker", + "bindings": { + "$ref": "#/components/serverBindings/devAmqp" + }, + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + } + }, + "security": [ + { + "$ref": "#/components/securitySchemes/oauth" + } + ] + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider in this example of `mycompany.com`" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignUp" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/components/servers/development" + } + ], + "bindings": { + "$ref": "#/components/channelBindings/user" + }, + "tags": [ + { + "$ref": "#/components/tags/user" + } + ], + "externalDocs": { + "$ref": "#/components/externalDocs/infoDocs" + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "payload": { + "$ref": "#/components/schemas/Category" + }, + "correlationId": { + "$ref": "#/components/correlationIds/default" + }, + "bindings": { + "$ref": "#/components/messageBindings/user" + }, + "examples": [] + }, + "userSignedUp": { + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + }, + "userSignedUpReply": { + "name": "UserSignupReply", + "title": "User signup reply", + "summary": "User signup reply message", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + }, + "userCompletedOrder": { + "summary": "User completed order event", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The ID of the order" + }, + "userId": { + "type": "string", + "description": "The ID of the user" + }, + "amount": { + "type": "number", + "description": "The total amount of the order" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "channel": { + "$ref": "#/channels/user" + }, + "bindings": { + "$ref": "#/components/operationBindings/sendUser" + }, + "traits": [ + { + "$ref": "#/components/operationTraits/binding" + } + ], + "reply": { + "$ref": "#/components/replies/signupReply" + } + } + }, + "replies": { + "signupReply": { + "address": { + "$ref": "#/components/replyAddresses/signupReply" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + } + } + }, + "replyAddresses": { + "signupReply": { + "location": "$message.header#/replyTo" + } + }, + "securitySchemes": { + "oauth": { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + }, + "operationTraits": { + "binding": { + "bindings": { + "amqp": { + "ack": false + } + } + }, + "kafka": { + "bindings": { + "kafka": { + "groupId": false + } + } + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + }, + "tags": { + "user": { + "name": "user", + "description": "User-related messages" + } + }, + "externalDocs": { + "infoDocs": { + "url": "https://example.com/docs", + "description": "Find more info here" + } + }, + "serverBindings": { + "devAmqp": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "channelBindings": { + "user": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + } + }, + "operationBindings": { + "sendUser": { + "amqp": { + "ack": false + } + } + }, + "messageBindings": { + "user": { + "amqp": { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + } + } + } +} \ No newline at end of file diff --git a/scripts/validation/updated-docs/Operations-Object.json b/scripts/validation/updated-docs/Operations-Object.json new file mode 100644 index 00000000..f114d80b --- /dev/null +++ b/scripts/validation/updated-docs/Operations-Object.json @@ -0,0 +1,719 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "AsyncAPI", + "version": "1.x.x", + "description": "This is a very good base doc, probably.", + "termsOfService": "https://asyncapi.org/terms/", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ] + }, + "servers": { + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Production RabbitMQ broker (uses the `production` vhost).", + "title": "Production Server", + "summary": "Production environment server", + "security": [ + { + "type": "http", + "scheme": "bearer" + } + ], + "tags": [ + { + "name": "production", + "description": "Production environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the production server", + "url": "https://example.com/docs/production" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "staging": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Staging RabbitMQ broker (uses the `staging` vhost).", + "title": "Staging Server", + "summary": "Staging environment server", + "security": [ + { + "type": "apiKey", + "in": "user", + "description": "Provide your API key as the user and leave the password empty." + } + ], + "tags": [ + { + "name": "staging", + "description": "Staging environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the staging server", + "url": "https://example.com/docs/staging" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "rabbitmqInProd": { + "host": "{prod}.in.mycompany.com", + "protocol": "amqp", + "description": "Production server" + }, + "rabbitmqInStaging": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "Staging server" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + }, + "userCompletedOrder": { + "$ref": "#/components/messages/userCompletedOrder" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/servers/production" + } + ], + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + }, + "tags": [ + { + "name": "user", + "description": "User-related messages" + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + }, + "userSignup": { + "address": "users.signup", + "description": "Channel for user signups", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + }, + "userSignupReply": { + "address": "users.signup.reply", + "description": "Channel for user signup replies", + "messages": { + "userSignedUpReply": { + "summary": "User signup reply message", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + } + } + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/user" + }, + "security": [ + { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "messages": [ + { + "$ref": "#/channels/user/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "#/channels/userSignupReply/messages/userSignedUpReply" + } + ] + }, + "traits": [] + }, + "onUserSignUp": { + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/userSignup" + }, + "action": "send", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "traits": [ + { + "$ref": "#/components/operationTraits/kafka" + } + ] + } + }, + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type": "record", + "name": "UserCreate", + "namespace": "com.example", + "fields": [ + { + "name": "id", + "type": "int" + }, + { + "name": "name", + "type": "string" + } + ] + } + }, + "userCreate": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the user" + }, + "name": { + "type": "string", + "description": "The name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "The email of the user" + } + }, + "required": [ + "id", + "name", + "email" + ] + }, + "signup": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the signup" + }, + "source": { + "type": "string", + "description": "The source of the signup" + } + }, + "required": [ + "timestamp", + "source" + ] + }, + "ComplexModel": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "zip": { + "type": "string" + } + } + }, + "ErrorModel": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } + } + }, + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "RabbitMQ broker", + "bindings": { + "$ref": "#/components/serverBindings/devAmqp" + }, + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + } + }, + "security": [ + { + "$ref": "#/components/securitySchemes/oauth" + } + ] + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider in this example of `mycompany.com`" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignUp" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/components/servers/development" + } + ], + "bindings": { + "$ref": "#/components/channelBindings/user" + }, + "tags": [ + { + "$ref": "#/components/tags/user" + } + ], + "externalDocs": { + "$ref": "#/components/externalDocs/infoDocs" + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "payload": { + "$ref": "#/components/schemas/Category" + }, + "correlationId": { + "$ref": "#/components/correlationIds/default" + }, + "bindings": { + "$ref": "#/components/messageBindings/user" + }, + "examples": [] + }, + "userSignedUp": { + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + }, + "userSignedUpReply": { + "name": "UserSignupReply", + "title": "User signup reply", + "summary": "User signup reply message", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + }, + "userCompletedOrder": { + "summary": "User completed order event", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The ID of the order" + }, + "userId": { + "type": "string", + "description": "The ID of the user" + }, + "amount": { + "type": "number", + "description": "The total amount of the order" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "channel": { + "$ref": "#/channels/user" + }, + "bindings": { + "$ref": "#/components/operationBindings/sendUser" + }, + "traits": [ + { + "$ref": "#/components/operationTraits/binding" + } + ], + "reply": { + "$ref": "#/components/replies/signupReply" + } + } + }, + "replies": { + "signupReply": { + "address": { + "$ref": "#/components/replyAddresses/signupReply" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + } + } + }, + "replyAddresses": { + "signupReply": { + "location": "$message.header#/replyTo" + } + }, + "securitySchemes": { + "oauth": { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + }, + "operationTraits": { + "binding": { + "bindings": { + "amqp": { + "ack": false + } + } + }, + "kafka": { + "bindings": { + "kafka": { + "groupId": false + } + } + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + }, + "tags": { + "user": { + "name": "user", + "description": "User-related messages" + } + }, + "externalDocs": { + "infoDocs": { + "url": "https://example.com/docs", + "description": "Find more info here" + } + }, + "serverBindings": { + "devAmqp": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "channelBindings": { + "user": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + } + }, + "operationBindings": { + "sendUser": { + "amqp": { + "ack": false + } + } + }, + "messageBindings": { + "user": { + "amqp": { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + } + } + } +} \ No newline at end of file diff --git a/scripts/validation/updated-docs/Reference-Object.json b/scripts/validation/updated-docs/Reference-Object.json new file mode 100644 index 00000000..42c29fbe --- /dev/null +++ b/scripts/validation/updated-docs/Reference-Object.json @@ -0,0 +1,689 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "AsyncAPI", + "version": "1.x.x", + "description": "This is a very good base doc, probably.", + "termsOfService": "https://asyncapi.org/terms/", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ] + }, + "servers": { + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Production RabbitMQ broker (uses the `production` vhost).", + "title": "Production Server", + "summary": "Production environment server", + "security": [ + { + "type": "http", + "scheme": "bearer" + } + ], + "tags": [ + { + "name": "production", + "description": "Production environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the production server", + "url": "https://example.com/docs/production" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "staging": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Staging RabbitMQ broker (uses the `staging` vhost).", + "title": "Staging Server", + "summary": "Staging environment server", + "security": [ + { + "type": "apiKey", + "in": "user", + "description": "Provide your API key as the user and leave the password empty." + } + ], + "tags": [ + { + "name": "staging", + "description": "Staging environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the staging server", + "url": "https://example.com/docs/staging" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "rabbitmqInProd": { + "host": "{prod}.in.mycompany.com", + "protocol": "amqp", + "description": "Production server" + }, + "rabbitmqInStaging": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "Staging server" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + }, + "userCompletedOrder": { + "$ref": "#/components/messages/userCompletedOrder" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/servers/production" + } + ], + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + }, + "tags": [ + { + "name": "user", + "description": "User-related messages" + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + }, + "userSignup": { + "address": "users.signup", + "description": "Channel for user signups", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + }, + "userSignupReply": { + "address": "users.signup.reply", + "description": "Channel for user signup replies", + "messages": { + "userSignedUpReply": { + "summary": "User signup reply message", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + } + } + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/user" + }, + "security": [ + { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "messages": [ + { + "$ref": "#/channels/user/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "#/channels/userSignupReply/messages/userSignedUpReply" + } + ] + }, + "traits": [] + } + }, + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type": "record", + "name": "UserCreate", + "namespace": "com.example", + "fields": [ + { + "name": "id", + "type": "int" + }, + { + "name": "name", + "type": "string" + } + ] + } + }, + "userCreate": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the user" + }, + "name": { + "type": "string", + "description": "The name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "The email of the user" + } + }, + "required": [ + "id", + "name", + "email" + ] + }, + "signup": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the signup" + }, + "source": { + "type": "string", + "description": "The source of the signup" + } + }, + "required": [ + "timestamp", + "source" + ] + }, + "ComplexModel": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "zip": { + "type": "string" + } + } + }, + "ErrorModel": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } + } + }, + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "RabbitMQ broker", + "bindings": { + "$ref": "#/components/serverBindings/devAmqp" + }, + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + } + }, + "security": [ + { + "$ref": "#/components/securitySchemes/oauth" + } + ] + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider in this example of `mycompany.com`" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignUp" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/components/servers/development" + } + ], + "bindings": { + "$ref": "#/components/channelBindings/user" + }, + "tags": [ + { + "$ref": "#/components/tags/user" + } + ], + "externalDocs": { + "$ref": "#/components/externalDocs/infoDocs" + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "payload": { + "$ref": "#/components/schemas/Pet" + }, + "correlationId": { + "$ref": "#/components/correlationIds/default" + }, + "bindings": { + "$ref": "#/components/messageBindings/user" + }, + "examples": [] + }, + "userSignedUp": { + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + }, + "userSignedUpReply": { + "name": "UserSignupReply", + "title": "User signup reply", + "summary": "User signup reply message", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + }, + "userCompletedOrder": { + "summary": "User completed order event", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The ID of the order" + }, + "userId": { + "type": "string", + "description": "The ID of the user" + }, + "amount": { + "type": "number", + "description": "The total amount of the order" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "channel": { + "$ref": "#/channels/user" + }, + "bindings": { + "$ref": "#/components/operationBindings/sendUser" + }, + "traits": [ + { + "$ref": "#/components/operationTraits/binding" + } + ], + "reply": { + "$ref": "#/components/replies/signupReply" + } + } + }, + "replies": { + "signupReply": { + "address": { + "$ref": "#/components/replyAddresses/signupReply" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + } + } + }, + "replyAddresses": { + "signupReply": { + "location": "$message.header#/replyTo" + } + }, + "securitySchemes": { + "oauth": { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + }, + "operationTraits": { + "binding": { + "bindings": { + "amqp": { + "ack": false + } + } + }, + "kafka": { + "bindings": { + "kafka": { + "groupId": false + } + } + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + }, + "tags": { + "user": { + "name": "user", + "description": "User-related messages" + } + }, + "externalDocs": { + "infoDocs": { + "url": "https://example.com/docs", + "description": "Find more info here" + } + }, + "serverBindings": { + "devAmqp": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "channelBindings": { + "user": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + } + }, + "operationBindings": { + "sendUser": { + "amqp": { + "ack": false + } + } + }, + "messageBindings": { + "user": { + "amqp": { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + } + } + } +} \ No newline at end of file diff --git a/scripts/validation/updated-docs/Schema-Object---Allowing-Complex-model.json b/scripts/validation/updated-docs/Schema-Object---Allowing-Complex-model.json new file mode 100644 index 00000000..35d88c1d --- /dev/null +++ b/scripts/validation/updated-docs/Schema-Object---Allowing-Complex-model.json @@ -0,0 +1,695 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "AsyncAPI", + "version": "1.x.x", + "description": "This is a very good base doc, probably.", + "termsOfService": "https://asyncapi.org/terms/", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ] + }, + "servers": { + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Production RabbitMQ broker (uses the `production` vhost).", + "title": "Production Server", + "summary": "Production environment server", + "security": [ + { + "type": "http", + "scheme": "bearer" + } + ], + "tags": [ + { + "name": "production", + "description": "Production environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the production server", + "url": "https://example.com/docs/production" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "staging": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Staging RabbitMQ broker (uses the `staging` vhost).", + "title": "Staging Server", + "summary": "Staging environment server", + "security": [ + { + "type": "apiKey", + "in": "user", + "description": "Provide your API key as the user and leave the password empty." + } + ], + "tags": [ + { + "name": "staging", + "description": "Staging environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the staging server", + "url": "https://example.com/docs/staging" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "rabbitmqInProd": { + "host": "{prod}.in.mycompany.com", + "protocol": "amqp", + "description": "Production server" + }, + "rabbitmqInStaging": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "Staging server" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + }, + "userCompletedOrder": { + "$ref": "#/components/messages/userCompletedOrder" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/servers/production" + } + ], + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + }, + "tags": [ + { + "name": "user", + "description": "User-related messages" + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + }, + "userSignup": { + "address": "users.signup", + "description": "Channel for user signups", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + }, + "userSignupReply": { + "address": "users.signup.reply", + "description": "Channel for user signup replies", + "messages": { + "userSignedUpReply": { + "summary": "User signup reply message", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + } + } + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/user" + }, + "security": [ + { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "messages": [ + { + "$ref": "#/channels/user/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "#/channels/userSignupReply/messages/userSignedUpReply" + } + ] + }, + "traits": [] + } + }, + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type": "record", + "name": "UserCreate", + "namespace": "com.example", + "fields": [ + { + "name": "id", + "type": "int" + }, + { + "name": "name", + "type": "string" + } + ] + } + }, + "userCreate": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the user" + }, + "name": { + "type": "string", + "description": "The name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "The email of the user" + } + }, + "required": [ + "id", + "name", + "email" + ] + }, + "signup": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the signup" + }, + "source": { + "type": "string", + "description": "The source of the signup" + } + }, + "required": [ + "timestamp", + "source" + ] + }, + "ComplexModel": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "zip": { + "type": "string" + } + } + }, + "ErrorModel": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } + } + }, + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + }, + "WithComplex": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/ComplexModel" + } + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "RabbitMQ broker", + "bindings": { + "$ref": "#/components/serverBindings/devAmqp" + }, + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + } + }, + "security": [ + { + "$ref": "#/components/securitySchemes/oauth" + } + ] + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider in this example of `mycompany.com`" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignUp" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/components/servers/development" + } + ], + "bindings": { + "$ref": "#/components/channelBindings/user" + }, + "tags": [ + { + "$ref": "#/components/tags/user" + } + ], + "externalDocs": { + "$ref": "#/components/externalDocs/infoDocs" + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "payload": { + "$ref": "#/components/schemas/Category" + }, + "correlationId": { + "$ref": "#/components/correlationIds/default" + }, + "bindings": { + "$ref": "#/components/messageBindings/user" + }, + "examples": [] + }, + "userSignedUp": { + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + }, + "userSignedUpReply": { + "name": "UserSignupReply", + "title": "User signup reply", + "summary": "User signup reply message", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + }, + "userCompletedOrder": { + "summary": "User completed order event", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The ID of the order" + }, + "userId": { + "type": "string", + "description": "The ID of the user" + }, + "amount": { + "type": "number", + "description": "The total amount of the order" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "channel": { + "$ref": "#/channels/user" + }, + "bindings": { + "$ref": "#/components/operationBindings/sendUser" + }, + "traits": [ + { + "$ref": "#/components/operationTraits/binding" + } + ], + "reply": { + "$ref": "#/components/replies/signupReply" + } + } + }, + "replies": { + "signupReply": { + "address": { + "$ref": "#/components/replyAddresses/signupReply" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + } + } + }, + "replyAddresses": { + "signupReply": { + "location": "$message.header#/replyTo" + } + }, + "securitySchemes": { + "oauth": { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + }, + "operationTraits": { + "binding": { + "bindings": { + "amqp": { + "ack": false + } + } + }, + "kafka": { + "bindings": { + "kafka": { + "groupId": false + } + } + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + }, + "tags": { + "user": { + "name": "user", + "description": "User-related messages" + } + }, + "externalDocs": { + "infoDocs": { + "url": "https://example.com/docs", + "description": "Find more info here" + } + }, + "serverBindings": { + "devAmqp": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "channelBindings": { + "user": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + } + }, + "operationBindings": { + "sendUser": { + "amqp": { + "ack": false + } + } + }, + "messageBindings": { + "user": { + "amqp": { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + } + } + } +} \ No newline at end of file diff --git a/scripts/validation/updated-docs/Schema-Object---Map-Dictionary-model.json b/scripts/validation/updated-docs/Schema-Object---Map-Dictionary-model.json new file mode 100644 index 00000000..0c8e8bab --- /dev/null +++ b/scripts/validation/updated-docs/Schema-Object---Map-Dictionary-model.json @@ -0,0 +1,695 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "AsyncAPI", + "version": "1.x.x", + "description": "This is a very good base doc, probably.", + "termsOfService": "https://asyncapi.org/terms/", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ] + }, + "servers": { + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Production RabbitMQ broker (uses the `production` vhost).", + "title": "Production Server", + "summary": "Production environment server", + "security": [ + { + "type": "http", + "scheme": "bearer" + } + ], + "tags": [ + { + "name": "production", + "description": "Production environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the production server", + "url": "https://example.com/docs/production" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "staging": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Staging RabbitMQ broker (uses the `staging` vhost).", + "title": "Staging Server", + "summary": "Staging environment server", + "security": [ + { + "type": "apiKey", + "in": "user", + "description": "Provide your API key as the user and leave the password empty." + } + ], + "tags": [ + { + "name": "staging", + "description": "Staging environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the staging server", + "url": "https://example.com/docs/staging" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "rabbitmqInProd": { + "host": "{prod}.in.mycompany.com", + "protocol": "amqp", + "description": "Production server" + }, + "rabbitmqInStaging": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "Staging server" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + }, + "userCompletedOrder": { + "$ref": "#/components/messages/userCompletedOrder" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/servers/production" + } + ], + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + }, + "tags": [ + { + "name": "user", + "description": "User-related messages" + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + }, + "userSignup": { + "address": "users.signup", + "description": "Channel for user signups", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + }, + "userSignupReply": { + "address": "users.signup.reply", + "description": "Channel for user signup replies", + "messages": { + "userSignedUpReply": { + "summary": "User signup reply message", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + } + } + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/user" + }, + "security": [ + { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "messages": [ + { + "$ref": "#/channels/user/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "#/channels/userSignupReply/messages/userSignedUpReply" + } + ] + }, + "traits": [] + } + }, + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type": "record", + "name": "UserCreate", + "namespace": "com.example", + "fields": [ + { + "name": "id", + "type": "int" + }, + { + "name": "name", + "type": "string" + } + ] + } + }, + "userCreate": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the user" + }, + "name": { + "type": "string", + "description": "The name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "The email of the user" + } + }, + "required": [ + "id", + "name", + "email" + ] + }, + "signup": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the signup" + }, + "source": { + "type": "string", + "description": "The source of the signup" + } + }, + "required": [ + "timestamp", + "source" + ] + }, + "ComplexModel": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "zip": { + "type": "string" + } + } + }, + "ErrorModel": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } + } + }, + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + }, + "Additional": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "RabbitMQ broker", + "bindings": { + "$ref": "#/components/serverBindings/devAmqp" + }, + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + } + }, + "security": [ + { + "$ref": "#/components/securitySchemes/oauth" + } + ] + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider in this example of `mycompany.com`" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignUp" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/components/servers/development" + } + ], + "bindings": { + "$ref": "#/components/channelBindings/user" + }, + "tags": [ + { + "$ref": "#/components/tags/user" + } + ], + "externalDocs": { + "$ref": "#/components/externalDocs/infoDocs" + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "payload": { + "$ref": "#/components/schemas/Category" + }, + "correlationId": { + "$ref": "#/components/correlationIds/default" + }, + "bindings": { + "$ref": "#/components/messageBindings/user" + }, + "examples": [] + }, + "userSignedUp": { + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + }, + "userSignedUpReply": { + "name": "UserSignupReply", + "title": "User signup reply", + "summary": "User signup reply message", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + }, + "userCompletedOrder": { + "summary": "User completed order event", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The ID of the order" + }, + "userId": { + "type": "string", + "description": "The ID of the user" + }, + "amount": { + "type": "number", + "description": "The total amount of the order" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "channel": { + "$ref": "#/channels/user" + }, + "bindings": { + "$ref": "#/components/operationBindings/sendUser" + }, + "traits": [ + { + "$ref": "#/components/operationTraits/binding" + } + ], + "reply": { + "$ref": "#/components/replies/signupReply" + } + } + }, + "replies": { + "signupReply": { + "address": { + "$ref": "#/components/replyAddresses/signupReply" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + } + } + }, + "replyAddresses": { + "signupReply": { + "location": "$message.header#/replyTo" + } + }, + "securitySchemes": { + "oauth": { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + }, + "operationTraits": { + "binding": { + "bindings": { + "amqp": { + "ack": false + } + } + }, + "kafka": { + "bindings": { + "kafka": { + "groupId": false + } + } + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + }, + "tags": { + "user": { + "name": "user", + "description": "User-related messages" + } + }, + "externalDocs": { + "infoDocs": { + "url": "https://example.com/docs", + "description": "Find more info here" + } + }, + "serverBindings": { + "devAmqp": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "channelBindings": { + "user": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + } + }, + "operationBindings": { + "sendUser": { + "amqp": { + "ack": false + } + } + }, + "messageBindings": { + "user": { + "amqp": { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + } + } + } +} \ No newline at end of file diff --git a/scripts/validation/updated-docs/Schema-Object---Primitive.json b/scripts/validation/updated-docs/Schema-Object---Primitive.json new file mode 100644 index 00000000..748640f3 --- /dev/null +++ b/scripts/validation/updated-docs/Schema-Object---Primitive.json @@ -0,0 +1,693 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "AsyncAPI", + "version": "1.x.x", + "description": "This is a very good base doc, probably.", + "termsOfService": "https://asyncapi.org/terms/", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ] + }, + "servers": { + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Production RabbitMQ broker (uses the `production` vhost).", + "title": "Production Server", + "summary": "Production environment server", + "security": [ + { + "type": "http", + "scheme": "bearer" + } + ], + "tags": [ + { + "name": "production", + "description": "Production environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the production server", + "url": "https://example.com/docs/production" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "staging": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Staging RabbitMQ broker (uses the `staging` vhost).", + "title": "Staging Server", + "summary": "Staging environment server", + "security": [ + { + "type": "apiKey", + "in": "user", + "description": "Provide your API key as the user and leave the password empty." + } + ], + "tags": [ + { + "name": "staging", + "description": "Staging environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the staging server", + "url": "https://example.com/docs/staging" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "rabbitmqInProd": { + "host": "{prod}.in.mycompany.com", + "protocol": "amqp", + "description": "Production server" + }, + "rabbitmqInStaging": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "Staging server" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + }, + "userCompletedOrder": { + "$ref": "#/components/messages/userCompletedOrder" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/servers/production" + } + ], + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + }, + "tags": [ + { + "name": "user", + "description": "User-related messages" + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + }, + "userSignup": { + "address": "users.signup", + "description": "Channel for user signups", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + }, + "userSignupReply": { + "address": "users.signup.reply", + "description": "Channel for user signup replies", + "messages": { + "userSignedUpReply": { + "summary": "User signup reply message", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + } + } + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/user" + }, + "security": [ + { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "messages": [ + { + "$ref": "#/channels/user/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "#/channels/userSignupReply/messages/userSignedUpReply" + } + ] + }, + "traits": [] + } + }, + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type": "record", + "name": "UserCreate", + "namespace": "com.example", + "fields": [ + { + "name": "id", + "type": "int" + }, + { + "name": "name", + "type": "string" + } + ] + } + }, + "userCreate": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the user" + }, + "name": { + "type": "string", + "description": "The name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "The email of the user" + } + }, + "required": [ + "id", + "name", + "email" + ] + }, + "signup": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the signup" + }, + "source": { + "type": "string", + "description": "The source of the signup" + } + }, + "required": [ + "timestamp", + "source" + ] + }, + "ComplexModel": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "zip": { + "type": "string" + } + } + }, + "ErrorModel": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } + } + }, + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + }, + "Email": { + "type": "string", + "format": "email" + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "RabbitMQ broker", + "bindings": { + "$ref": "#/components/serverBindings/devAmqp" + }, + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + } + }, + "security": [ + { + "$ref": "#/components/securitySchemes/oauth" + } + ] + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider in this example of `mycompany.com`" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignUp" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/components/servers/development" + } + ], + "bindings": { + "$ref": "#/components/channelBindings/user" + }, + "tags": [ + { + "$ref": "#/components/tags/user" + } + ], + "externalDocs": { + "$ref": "#/components/externalDocs/infoDocs" + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "payload": { + "$ref": "#/components/schemas/Category" + }, + "correlationId": { + "$ref": "#/components/correlationIds/default" + }, + "bindings": { + "$ref": "#/components/messageBindings/user" + }, + "examples": [] + }, + "userSignedUp": { + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + }, + "userSignedUpReply": { + "name": "UserSignupReply", + "title": "User signup reply", + "summary": "User signup reply message", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + }, + "userCompletedOrder": { + "summary": "User completed order event", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The ID of the order" + }, + "userId": { + "type": "string", + "description": "The ID of the user" + }, + "amount": { + "type": "number", + "description": "The total amount of the order" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "channel": { + "$ref": "#/channels/user" + }, + "bindings": { + "$ref": "#/components/operationBindings/sendUser" + }, + "traits": [ + { + "$ref": "#/components/operationTraits/binding" + } + ], + "reply": { + "$ref": "#/components/replies/signupReply" + } + } + }, + "replies": { + "signupReply": { + "address": { + "$ref": "#/components/replyAddresses/signupReply" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + } + } + }, + "replyAddresses": { + "signupReply": { + "location": "$message.header#/replyTo" + } + }, + "securitySchemes": { + "oauth": { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + }, + "operationTraits": { + "binding": { + "bindings": { + "amqp": { + "ack": false + } + } + }, + "kafka": { + "bindings": { + "kafka": { + "groupId": false + } + } + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + }, + "tags": { + "user": { + "name": "user", + "description": "User-related messages" + } + }, + "externalDocs": { + "infoDocs": { + "url": "https://example.com/docs", + "description": "Find more info here" + } + }, + "serverBindings": { + "devAmqp": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "channelBindings": { + "user": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + } + }, + "operationBindings": { + "sendUser": { + "amqp": { + "ack": false + } + } + }, + "messageBindings": { + "user": { + "amqp": { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + } + } + } +} \ No newline at end of file diff --git a/scripts/validation/updated-docs/Schema-Object---Simple-model.json b/scripts/validation/updated-docs/Schema-Object---Simple-model.json new file mode 100644 index 00000000..7bb535a5 --- /dev/null +++ b/scripts/validation/updated-docs/Schema-Object---Simple-model.json @@ -0,0 +1,708 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "AsyncAPI", + "version": "1.x.x", + "description": "This is a very good base doc, probably.", + "termsOfService": "https://asyncapi.org/terms/", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ] + }, + "servers": { + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Production RabbitMQ broker (uses the `production` vhost).", + "title": "Production Server", + "summary": "Production environment server", + "security": [ + { + "type": "http", + "scheme": "bearer" + } + ], + "tags": [ + { + "name": "production", + "description": "Production environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the production server", + "url": "https://example.com/docs/production" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "staging": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Staging RabbitMQ broker (uses the `staging` vhost).", + "title": "Staging Server", + "summary": "Staging environment server", + "security": [ + { + "type": "apiKey", + "in": "user", + "description": "Provide your API key as the user and leave the password empty." + } + ], + "tags": [ + { + "name": "staging", + "description": "Staging environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the staging server", + "url": "https://example.com/docs/staging" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "rabbitmqInProd": { + "host": "{prod}.in.mycompany.com", + "protocol": "amqp", + "description": "Production server" + }, + "rabbitmqInStaging": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "Staging server" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + }, + "userCompletedOrder": { + "$ref": "#/components/messages/userCompletedOrder" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/servers/production" + } + ], + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + }, + "tags": [ + { + "name": "user", + "description": "User-related messages" + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + }, + "userSignup": { + "address": "users.signup", + "description": "Channel for user signups", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + }, + "userSignupReply": { + "address": "users.signup.reply", + "description": "Channel for user signup replies", + "messages": { + "userSignedUpReply": { + "summary": "User signup reply message", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + } + } + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/user" + }, + "security": [ + { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "messages": [ + { + "$ref": "#/channels/user/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "#/channels/userSignupReply/messages/userSignedUpReply" + } + ] + }, + "traits": [] + } + }, + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type": "record", + "name": "UserCreate", + "namespace": "com.example", + "fields": [ + { + "name": "id", + "type": "int" + }, + { + "name": "name", + "type": "string" + } + ] + } + }, + "userCreate": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the user" + }, + "name": { + "type": "string", + "description": "The name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "The email of the user" + } + }, + "required": [ + "id", + "name", + "email" + ] + }, + "signup": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the signup" + }, + "source": { + "type": "string", + "description": "The source of the signup" + } + }, + "required": [ + "timestamp", + "source" + ] + }, + "ComplexModel": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "zip": { + "type": "string" + } + } + }, + "ErrorModel": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } + } + }, + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + }, + "Person": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "address": { + "$ref": "#/components/schemas/Address" + }, + "age": { + "type": "integer", + "format": "int32", + "minimum": 0 + } + } + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "RabbitMQ broker", + "bindings": { + "$ref": "#/components/serverBindings/devAmqp" + }, + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + } + }, + "security": [ + { + "$ref": "#/components/securitySchemes/oauth" + } + ] + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider in this example of `mycompany.com`" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignUp" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/components/servers/development" + } + ], + "bindings": { + "$ref": "#/components/channelBindings/user" + }, + "tags": [ + { + "$ref": "#/components/tags/user" + } + ], + "externalDocs": { + "$ref": "#/components/externalDocs/infoDocs" + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "payload": { + "$ref": "#/components/schemas/Category" + }, + "correlationId": { + "$ref": "#/components/correlationIds/default" + }, + "bindings": { + "$ref": "#/components/messageBindings/user" + }, + "examples": [] + }, + "userSignedUp": { + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + }, + "userSignedUpReply": { + "name": "UserSignupReply", + "title": "User signup reply", + "summary": "User signup reply message", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + }, + "userCompletedOrder": { + "summary": "User completed order event", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The ID of the order" + }, + "userId": { + "type": "string", + "description": "The ID of the user" + }, + "amount": { + "type": "number", + "description": "The total amount of the order" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "channel": { + "$ref": "#/channels/user" + }, + "bindings": { + "$ref": "#/components/operationBindings/sendUser" + }, + "traits": [ + { + "$ref": "#/components/operationTraits/binding" + } + ], + "reply": { + "$ref": "#/components/replies/signupReply" + } + } + }, + "replies": { + "signupReply": { + "address": { + "$ref": "#/components/replyAddresses/signupReply" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + } + } + }, + "replyAddresses": { + "signupReply": { + "location": "$message.header#/replyTo" + } + }, + "securitySchemes": { + "oauth": { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + }, + "operationTraits": { + "binding": { + "bindings": { + "amqp": { + "ack": false + } + } + }, + "kafka": { + "bindings": { + "kafka": { + "groupId": false + } + } + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + }, + "tags": { + "user": { + "name": "user", + "description": "User-related messages" + } + }, + "externalDocs": { + "infoDocs": { + "url": "https://example.com/docs", + "description": "Find more info here" + } + }, + "serverBindings": { + "devAmqp": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "channelBindings": { + "user": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + } + }, + "operationBindings": { + "sendUser": { + "amqp": { + "ack": false + } + } + }, + "messageBindings": { + "user": { + "amqp": { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + } + } + } +} \ No newline at end of file diff --git a/scripts/validation/updated-docs/Schema-Object---With-boolean-model.json b/scripts/validation/updated-docs/Schema-Object---With-boolean-model.json new file mode 100644 index 00000000..8ba86715 --- /dev/null +++ b/scripts/validation/updated-docs/Schema-Object---With-boolean-model.json @@ -0,0 +1,699 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "AsyncAPI", + "version": "1.x.x", + "description": "This is a very good base doc, probably.", + "termsOfService": "https://asyncapi.org/terms/", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ] + }, + "servers": { + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Production RabbitMQ broker (uses the `production` vhost).", + "title": "Production Server", + "summary": "Production environment server", + "security": [ + { + "type": "http", + "scheme": "bearer" + } + ], + "tags": [ + { + "name": "production", + "description": "Production environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the production server", + "url": "https://example.com/docs/production" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "staging": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Staging RabbitMQ broker (uses the `staging` vhost).", + "title": "Staging Server", + "summary": "Staging environment server", + "security": [ + { + "type": "apiKey", + "in": "user", + "description": "Provide your API key as the user and leave the password empty." + } + ], + "tags": [ + { + "name": "staging", + "description": "Staging environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the staging server", + "url": "https://example.com/docs/staging" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "rabbitmqInProd": { + "host": "{prod}.in.mycompany.com", + "protocol": "amqp", + "description": "Production server" + }, + "rabbitmqInStaging": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "Staging server" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + }, + "userCompletedOrder": { + "$ref": "#/components/messages/userCompletedOrder" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/servers/production" + } + ], + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + }, + "tags": [ + { + "name": "user", + "description": "User-related messages" + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + }, + "userSignup": { + "address": "users.signup", + "description": "Channel for user signups", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + }, + "userSignupReply": { + "address": "users.signup.reply", + "description": "Channel for user signup replies", + "messages": { + "userSignedUpReply": { + "summary": "User signup reply message", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + } + } + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/user" + }, + "security": [ + { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "messages": [ + { + "$ref": "#/channels/user/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "#/channels/userSignupReply/messages/userSignedUpReply" + } + ] + }, + "traits": [] + } + }, + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type": "record", + "name": "UserCreate", + "namespace": "com.example", + "fields": [ + { + "name": "id", + "type": "int" + }, + { + "name": "name", + "type": "string" + } + ] + } + }, + "userCreate": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the user" + }, + "name": { + "type": "string", + "description": "The name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "The email of the user" + } + }, + "required": [ + "id", + "name", + "email" + ] + }, + "signup": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the signup" + }, + "source": { + "type": "string", + "description": "The source of the signup" + } + }, + "required": [ + "timestamp", + "source" + ] + }, + "ComplexModel": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "zip": { + "type": "string" + } + } + }, + "ErrorModel": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } + } + }, + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + }, + "WithBoolean": { + "type": "object", + "required": [ + "anySchema" + ], + "properties": { + "anySchema": true, + "cannotBeDefined": false + } + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "RabbitMQ broker", + "bindings": { + "$ref": "#/components/serverBindings/devAmqp" + }, + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + } + }, + "security": [ + { + "$ref": "#/components/securitySchemes/oauth" + } + ] + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider in this example of `mycompany.com`" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignUp" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/components/servers/development" + } + ], + "bindings": { + "$ref": "#/components/channelBindings/user" + }, + "tags": [ + { + "$ref": "#/components/tags/user" + } + ], + "externalDocs": { + "$ref": "#/components/externalDocs/infoDocs" + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "payload": { + "$ref": "#/components/schemas/Category" + }, + "correlationId": { + "$ref": "#/components/correlationIds/default" + }, + "bindings": { + "$ref": "#/components/messageBindings/user" + }, + "examples": [] + }, + "userSignedUp": { + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + }, + "userSignedUpReply": { + "name": "UserSignupReply", + "title": "User signup reply", + "summary": "User signup reply message", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + }, + "userCompletedOrder": { + "summary": "User completed order event", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The ID of the order" + }, + "userId": { + "type": "string", + "description": "The ID of the user" + }, + "amount": { + "type": "number", + "description": "The total amount of the order" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "channel": { + "$ref": "#/channels/user" + }, + "bindings": { + "$ref": "#/components/operationBindings/sendUser" + }, + "traits": [ + { + "$ref": "#/components/operationTraits/binding" + } + ], + "reply": { + "$ref": "#/components/replies/signupReply" + } + } + }, + "replies": { + "signupReply": { + "address": { + "$ref": "#/components/replyAddresses/signupReply" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + } + } + }, + "replyAddresses": { + "signupReply": { + "location": "$message.header#/replyTo" + } + }, + "securitySchemes": { + "oauth": { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + }, + "operationTraits": { + "binding": { + "bindings": { + "amqp": { + "ack": false + } + } + }, + "kafka": { + "bindings": { + "kafka": { + "groupId": false + } + } + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + }, + "tags": { + "user": { + "name": "user", + "description": "User-related messages" + } + }, + "externalDocs": { + "infoDocs": { + "url": "https://example.com/docs", + "description": "Find more info here" + } + }, + "serverBindings": { + "devAmqp": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "channelBindings": { + "user": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + } + }, + "operationBindings": { + "sendUser": { + "amqp": { + "ack": false + } + } + }, + "messageBindings": { + "user": { + "amqp": { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + } + } + } +} \ No newline at end of file diff --git a/scripts/validation/updated-docs/Schema-Object---With-composition-model.json b/scripts/validation/updated-docs/Schema-Object---With-composition-model.json new file mode 100644 index 00000000..1dc47db1 --- /dev/null +++ b/scripts/validation/updated-docs/Schema-Object---With-composition-model.json @@ -0,0 +1,728 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "AsyncAPI", + "version": "1.x.x", + "description": "This is a very good base doc, probably.", + "termsOfService": "https://asyncapi.org/terms/", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ] + }, + "servers": { + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Production RabbitMQ broker (uses the `production` vhost).", + "title": "Production Server", + "summary": "Production environment server", + "security": [ + { + "type": "http", + "scheme": "bearer" + } + ], + "tags": [ + { + "name": "production", + "description": "Production environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the production server", + "url": "https://example.com/docs/production" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "staging": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Staging RabbitMQ broker (uses the `staging` vhost).", + "title": "Staging Server", + "summary": "Staging environment server", + "security": [ + { + "type": "apiKey", + "in": "user", + "description": "Provide your API key as the user and leave the password empty." + } + ], + "tags": [ + { + "name": "staging", + "description": "Staging environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the staging server", + "url": "https://example.com/docs/staging" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "rabbitmqInProd": { + "host": "{prod}.in.mycompany.com", + "protocol": "amqp", + "description": "Production server" + }, + "rabbitmqInStaging": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "Staging server" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + }, + "userCompletedOrder": { + "$ref": "#/components/messages/userCompletedOrder" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/servers/production" + } + ], + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + }, + "tags": [ + { + "name": "user", + "description": "User-related messages" + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + }, + "userSignup": { + "address": "users.signup", + "description": "Channel for user signups", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + }, + "userSignupReply": { + "address": "users.signup.reply", + "description": "Channel for user signup replies", + "messages": { + "userSignedUpReply": { + "summary": "User signup reply message", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + } + } + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/user" + }, + "security": [ + { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "messages": [ + { + "$ref": "#/channels/user/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "#/channels/userSignupReply/messages/userSignedUpReply" + } + ] + }, + "traits": [] + } + }, + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type": "record", + "name": "UserCreate", + "namespace": "com.example", + "fields": [ + { + "name": "id", + "type": "int" + }, + { + "name": "name", + "type": "string" + } + ] + } + }, + "userCreate": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the user" + }, + "name": { + "type": "string", + "description": "The name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "The email of the user" + } + }, + "required": [ + "id", + "name", + "email" + ] + }, + "signup": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the signup" + }, + "source": { + "type": "string", + "description": "The source of the signup" + } + }, + "required": [ + "timestamp", + "source" + ] + }, + "ComplexModel": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "zip": { + "type": "string" + } + } + }, + "ErrorModel": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } + } + }, + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + }, + "WithComposition": { + "schemas": { + "ErrorModel": { + "type": "object", + "required": [ + "message", + "code" + ], + "properties": { + "message": { + "type": "string" + }, + "code": { + "type": "integer", + "minimum": 100, + "maximum": 600 + } + } + }, + "ExtendedErrorModel": { + "allOf": [ + { + "$ref": "#/components/schemas/ErrorModel" + }, + { + "type": "object", + "required": [ + "rootCause" + ], + "properties": { + "rootCause": { + "type": "string" + } + } + } + ] + } + } + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "RabbitMQ broker", + "bindings": { + "$ref": "#/components/serverBindings/devAmqp" + }, + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + } + }, + "security": [ + { + "$ref": "#/components/securitySchemes/oauth" + } + ] + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider in this example of `mycompany.com`" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignUp" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/components/servers/development" + } + ], + "bindings": { + "$ref": "#/components/channelBindings/user" + }, + "tags": [ + { + "$ref": "#/components/tags/user" + } + ], + "externalDocs": { + "$ref": "#/components/externalDocs/infoDocs" + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "payload": { + "$ref": "#/components/schemas/Category" + }, + "correlationId": { + "$ref": "#/components/correlationIds/default" + }, + "bindings": { + "$ref": "#/components/messageBindings/user" + }, + "examples": [] + }, + "userSignedUp": { + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + }, + "userSignedUpReply": { + "name": "UserSignupReply", + "title": "User signup reply", + "summary": "User signup reply message", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + }, + "userCompletedOrder": { + "summary": "User completed order event", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The ID of the order" + }, + "userId": { + "type": "string", + "description": "The ID of the user" + }, + "amount": { + "type": "number", + "description": "The total amount of the order" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "channel": { + "$ref": "#/channels/user" + }, + "bindings": { + "$ref": "#/components/operationBindings/sendUser" + }, + "traits": [ + { + "$ref": "#/components/operationTraits/binding" + } + ], + "reply": { + "$ref": "#/components/replies/signupReply" + } + } + }, + "replies": { + "signupReply": { + "address": { + "$ref": "#/components/replyAddresses/signupReply" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + } + } + }, + "replyAddresses": { + "signupReply": { + "location": "$message.header#/replyTo" + } + }, + "securitySchemes": { + "oauth": { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + }, + "operationTraits": { + "binding": { + "bindings": { + "amqp": { + "ack": false + } + } + }, + "kafka": { + "bindings": { + "kafka": { + "groupId": false + } + } + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + }, + "tags": { + "user": { + "name": "user", + "description": "User-related messages" + } + }, + "externalDocs": { + "infoDocs": { + "url": "https://example.com/docs", + "description": "Find more info here" + } + }, + "serverBindings": { + "devAmqp": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "channelBindings": { + "user": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + } + }, + "operationBindings": { + "sendUser": { + "amqp": { + "ack": false + } + } + }, + "messageBindings": { + "user": { + "amqp": { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + } + } + } +} \ No newline at end of file diff --git a/scripts/validation/updated-docs/Schema-Object---With-examples-model.json b/scripts/validation/updated-docs/Schema-Object---With-examples-model.json new file mode 100644 index 00000000..85a56bbb --- /dev/null +++ b/scripts/validation/updated-docs/Schema-Object---With-examples-model.json @@ -0,0 +1,710 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "AsyncAPI", + "version": "1.x.x", + "description": "This is a very good base doc, probably.", + "termsOfService": "https://asyncapi.org/terms/", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ] + }, + "servers": { + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Production RabbitMQ broker (uses the `production` vhost).", + "title": "Production Server", + "summary": "Production environment server", + "security": [ + { + "type": "http", + "scheme": "bearer" + } + ], + "tags": [ + { + "name": "production", + "description": "Production environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the production server", + "url": "https://example.com/docs/production" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "staging": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Staging RabbitMQ broker (uses the `staging` vhost).", + "title": "Staging Server", + "summary": "Staging environment server", + "security": [ + { + "type": "apiKey", + "in": "user", + "description": "Provide your API key as the user and leave the password empty." + } + ], + "tags": [ + { + "name": "staging", + "description": "Staging environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the staging server", + "url": "https://example.com/docs/staging" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "rabbitmqInProd": { + "host": "{prod}.in.mycompany.com", + "protocol": "amqp", + "description": "Production server" + }, + "rabbitmqInStaging": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "Staging server" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + }, + "userCompletedOrder": { + "$ref": "#/components/messages/userCompletedOrder" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/servers/production" + } + ], + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + }, + "tags": [ + { + "name": "user", + "description": "User-related messages" + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + }, + "userSignup": { + "address": "users.signup", + "description": "Channel for user signups", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + }, + "userSignupReply": { + "address": "users.signup.reply", + "description": "Channel for user signup replies", + "messages": { + "userSignedUpReply": { + "summary": "User signup reply message", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + } + } + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/user" + }, + "security": [ + { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "messages": [ + { + "$ref": "#/channels/user/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "#/channels/userSignupReply/messages/userSignedUpReply" + } + ] + }, + "traits": [] + } + }, + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type": "record", + "name": "UserCreate", + "namespace": "com.example", + "fields": [ + { + "name": "id", + "type": "int" + }, + { + "name": "name", + "type": "string" + } + ] + } + }, + "userCreate": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the user" + }, + "name": { + "type": "string", + "description": "The name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "The email of the user" + } + }, + "required": [ + "id", + "name", + "email" + ] + }, + "signup": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the signup" + }, + "source": { + "type": "string", + "description": "The source of the signup" + } + }, + "required": [ + "timestamp", + "source" + ] + }, + "ComplexModel": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "zip": { + "type": "string" + } + } + }, + "ErrorModel": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } + } + }, + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + }, + "WithExamples": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "examples": [ + { + "name": "Puma", + "id": 1 + } + ] + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "RabbitMQ broker", + "bindings": { + "$ref": "#/components/serverBindings/devAmqp" + }, + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + } + }, + "security": [ + { + "$ref": "#/components/securitySchemes/oauth" + } + ] + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider in this example of `mycompany.com`" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignUp" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/components/servers/development" + } + ], + "bindings": { + "$ref": "#/components/channelBindings/user" + }, + "tags": [ + { + "$ref": "#/components/tags/user" + } + ], + "externalDocs": { + "$ref": "#/components/externalDocs/infoDocs" + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "payload": { + "$ref": "#/components/schemas/Category" + }, + "correlationId": { + "$ref": "#/components/correlationIds/default" + }, + "bindings": { + "$ref": "#/components/messageBindings/user" + }, + "examples": [] + }, + "userSignedUp": { + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + }, + "userSignedUpReply": { + "name": "UserSignupReply", + "title": "User signup reply", + "summary": "User signup reply message", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + }, + "userCompletedOrder": { + "summary": "User completed order event", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The ID of the order" + }, + "userId": { + "type": "string", + "description": "The ID of the user" + }, + "amount": { + "type": "number", + "description": "The total amount of the order" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "channel": { + "$ref": "#/channels/user" + }, + "bindings": { + "$ref": "#/components/operationBindings/sendUser" + }, + "traits": [ + { + "$ref": "#/components/operationTraits/binding" + } + ], + "reply": { + "$ref": "#/components/replies/signupReply" + } + } + }, + "replies": { + "signupReply": { + "address": { + "$ref": "#/components/replyAddresses/signupReply" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + } + } + }, + "replyAddresses": { + "signupReply": { + "location": "$message.header#/replyTo" + } + }, + "securitySchemes": { + "oauth": { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + }, + "operationTraits": { + "binding": { + "bindings": { + "amqp": { + "ack": false + } + } + }, + "kafka": { + "bindings": { + "kafka": { + "groupId": false + } + } + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + }, + "tags": { + "user": { + "name": "user", + "description": "User-related messages" + } + }, + "externalDocs": { + "infoDocs": { + "url": "https://example.com/docs", + "description": "Find more info here" + } + }, + "serverBindings": { + "devAmqp": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "channelBindings": { + "user": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + } + }, + "operationBindings": { + "sendUser": { + "amqp": { + "ack": false + } + } + }, + "messageBindings": { + "user": { + "amqp": { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + } + } + } +} \ No newline at end of file diff --git a/scripts/validation/updated-docs/Schema-Object---With-polymorphism-model.json b/scripts/validation/updated-docs/Schema-Object---With-polymorphism-model.json new file mode 100644 index 00000000..5aaac595 --- /dev/null +++ b/scripts/validation/updated-docs/Schema-Object---With-polymorphism-model.json @@ -0,0 +1,779 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "AsyncAPI", + "version": "1.x.x", + "description": "This is a very good base doc, probably.", + "termsOfService": "https://asyncapi.org/terms/", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ] + }, + "servers": { + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Production RabbitMQ broker (uses the `production` vhost).", + "title": "Production Server", + "summary": "Production environment server", + "security": [ + { + "type": "http", + "scheme": "bearer" + } + ], + "tags": [ + { + "name": "production", + "description": "Production environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the production server", + "url": "https://example.com/docs/production" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "staging": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Staging RabbitMQ broker (uses the `staging` vhost).", + "title": "Staging Server", + "summary": "Staging environment server", + "security": [ + { + "type": "apiKey", + "in": "user", + "description": "Provide your API key as the user and leave the password empty." + } + ], + "tags": [ + { + "name": "staging", + "description": "Staging environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the staging server", + "url": "https://example.com/docs/staging" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "rabbitmqInProd": { + "host": "{prod}.in.mycompany.com", + "protocol": "amqp", + "description": "Production server" + }, + "rabbitmqInStaging": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "Staging server" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + }, + "userCompletedOrder": { + "$ref": "#/components/messages/userCompletedOrder" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/servers/production" + } + ], + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + }, + "tags": [ + { + "name": "user", + "description": "User-related messages" + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + }, + "userSignup": { + "address": "users.signup", + "description": "Channel for user signups", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + }, + "userSignupReply": { + "address": "users.signup.reply", + "description": "Channel for user signup replies", + "messages": { + "userSignedUpReply": { + "summary": "User signup reply message", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + } + } + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/user" + }, + "security": [ + { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "messages": [ + { + "$ref": "#/channels/user/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "#/channels/userSignupReply/messages/userSignedUpReply" + } + ] + }, + "traits": [] + } + }, + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type": "record", + "name": "UserCreate", + "namespace": "com.example", + "fields": [ + { + "name": "id", + "type": "int" + }, + { + "name": "name", + "type": "string" + } + ] + } + }, + "userCreate": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the user" + }, + "name": { + "type": "string", + "description": "The name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "The email of the user" + } + }, + "required": [ + "id", + "name", + "email" + ] + }, + "signup": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the signup" + }, + "source": { + "type": "string", + "description": "The source of the signup" + } + }, + "required": [ + "timestamp", + "source" + ] + }, + "ComplexModel": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "zip": { + "type": "string" + } + } + }, + "ErrorModel": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } + } + }, + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + }, + "WithPolymorphism": { + "schemas": { + "Pet": { + "type": "object", + "discriminator": "petType", + "properties": { + "name": { + "type": "string" + }, + "petType": { + "type": "string" + } + }, + "required": [ + "name", + "petType" + ] + }, + "Cat": { + "description": "A representation of a cat. Note that `Cat` will be used as the discriminator value.", + "allOf": [ + { + "$ref": "#/components/schemas/Pet" + }, + { + "type": "object", + "properties": { + "huntingSkill": { + "type": "string", + "description": "The measured skill for hunting", + "enum": [ + "clueless", + "lazy", + "adventurous", + "aggressive" + ] + } + }, + "required": [ + "huntingSkill" + ] + } + ] + }, + "Dog": { + "description": "A representation of a dog. Note that `Dog` will be used as the discriminator value.", + "allOf": [ + { + "$ref": "#/components/schemas/Pet" + }, + { + "type": "object", + "properties": { + "packSize": { + "type": "integer", + "format": "int32", + "description": "the size of the pack the dog is from", + "minimum": 0 + } + }, + "required": [ + "packSize" + ] + } + ] + }, + "StickInsect": { + "description": "A representation of an Australian walking stick. Note that `StickBug` will be used as the discriminator value.", + "allOf": [ + { + "$ref": "#/components/schemas/Pet" + }, + { + "type": "object", + "properties": { + "petType": { + "const": "StickBug" + }, + "color": { + "type": "string" + } + }, + "required": [ + "color" + ] + } + ] + } + } + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "RabbitMQ broker", + "bindings": { + "$ref": "#/components/serverBindings/devAmqp" + }, + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + } + }, + "security": [ + { + "$ref": "#/components/securitySchemes/oauth" + } + ] + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider in this example of `mycompany.com`" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignUp" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/components/servers/development" + } + ], + "bindings": { + "$ref": "#/components/channelBindings/user" + }, + "tags": [ + { + "$ref": "#/components/tags/user" + } + ], + "externalDocs": { + "$ref": "#/components/externalDocs/infoDocs" + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "payload": { + "$ref": "#/components/schemas/Category" + }, + "correlationId": { + "$ref": "#/components/correlationIds/default" + }, + "bindings": { + "$ref": "#/components/messageBindings/user" + }, + "examples": [] + }, + "userSignedUp": { + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + }, + "userSignedUpReply": { + "name": "UserSignupReply", + "title": "User signup reply", + "summary": "User signup reply message", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + }, + "userCompletedOrder": { + "summary": "User completed order event", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The ID of the order" + }, + "userId": { + "type": "string", + "description": "The ID of the user" + }, + "amount": { + "type": "number", + "description": "The total amount of the order" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "channel": { + "$ref": "#/channels/user" + }, + "bindings": { + "$ref": "#/components/operationBindings/sendUser" + }, + "traits": [ + { + "$ref": "#/components/operationTraits/binding" + } + ], + "reply": { + "$ref": "#/components/replies/signupReply" + } + } + }, + "replies": { + "signupReply": { + "address": { + "$ref": "#/components/replyAddresses/signupReply" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + } + } + }, + "replyAddresses": { + "signupReply": { + "location": "$message.header#/replyTo" + } + }, + "securitySchemes": { + "oauth": { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + }, + "operationTraits": { + "binding": { + "bindings": { + "amqp": { + "ack": false + } + } + }, + "kafka": { + "bindings": { + "kafka": { + "groupId": false + } + } + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + }, + "tags": { + "user": { + "name": "user", + "description": "User-related messages" + } + }, + "externalDocs": { + "infoDocs": { + "url": "https://example.com/docs", + "description": "Find more info here" + } + }, + "serverBindings": { + "devAmqp": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "channelBindings": { + "user": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + } + }, + "operationBindings": { + "sendUser": { + "amqp": { + "ack": false + } + } + }, + "messageBindings": { + "user": { + "amqp": { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + } + } + } +} \ No newline at end of file diff --git a/scripts/validation/updated-docs/Security-Scheme-OAuth-Flow-Object.json b/scripts/validation/updated-docs/Security-Scheme-OAuth-Flow-Object.json new file mode 100644 index 00000000..fc919a87 --- /dev/null +++ b/scripts/validation/updated-docs/Security-Scheme-OAuth-Flow-Object.json @@ -0,0 +1,692 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "AsyncAPI", + "version": "1.x.x", + "description": "This is a very good base doc, probably.", + "termsOfService": "https://asyncapi.org/terms/", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ] + }, + "servers": { + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Production RabbitMQ broker (uses the `production` vhost).", + "title": "Production Server", + "summary": "Production environment server", + "security": [ + { + "type": "http", + "scheme": "bearer" + } + ], + "tags": [ + { + "name": "production", + "description": "Production environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the production server", + "url": "https://example.com/docs/production" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "staging": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Staging RabbitMQ broker (uses the `staging` vhost).", + "title": "Staging Server", + "summary": "Staging environment server", + "security": [ + { + "type": "apiKey", + "in": "user", + "description": "Provide your API key as the user and leave the password empty." + } + ], + "tags": [ + { + "name": "staging", + "description": "Staging environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the staging server", + "url": "https://example.com/docs/staging" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "rabbitmqInProd": { + "host": "{prod}.in.mycompany.com", + "protocol": "amqp", + "description": "Production server" + }, + "rabbitmqInStaging": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "Staging server" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + }, + "userCompletedOrder": { + "$ref": "#/components/messages/userCompletedOrder" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/servers/production" + } + ], + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + }, + "tags": [ + { + "name": "user", + "description": "User-related messages" + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + }, + "userSignup": { + "address": "users.signup", + "description": "Channel for user signups", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + }, + "userSignupReply": { + "address": "users.signup.reply", + "description": "Channel for user signup replies", + "messages": { + "userSignedUpReply": { + "summary": "User signup reply message", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + } + } + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/user" + }, + "security": [ + { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "messages": [ + { + "$ref": "#/channels/user/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "#/channels/userSignupReply/messages/userSignedUpReply" + } + ] + }, + "traits": [] + } + }, + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type": "record", + "name": "UserCreate", + "namespace": "com.example", + "fields": [ + { + "name": "id", + "type": "int" + }, + { + "name": "name", + "type": "string" + } + ] + } + }, + "userCreate": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the user" + }, + "name": { + "type": "string", + "description": "The name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "The email of the user" + } + }, + "required": [ + "id", + "name", + "email" + ] + }, + "signup": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the signup" + }, + "source": { + "type": "string", + "description": "The source of the signup" + } + }, + "required": [ + "timestamp", + "source" + ] + }, + "ComplexModel": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "zip": { + "type": "string" + } + } + }, + "ErrorModel": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } + } + }, + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "RabbitMQ broker", + "bindings": { + "$ref": "#/components/serverBindings/devAmqp" + }, + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + } + }, + "security": [ + { + "$ref": "#/components/securitySchemes/oauth" + } + ] + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider in this example of `mycompany.com`" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignUp" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/components/servers/development" + } + ], + "bindings": { + "$ref": "#/components/channelBindings/user" + }, + "tags": [ + { + "$ref": "#/components/tags/user" + } + ], + "externalDocs": { + "$ref": "#/components/externalDocs/infoDocs" + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "payload": { + "$ref": "#/components/schemas/Category" + }, + "correlationId": { + "$ref": "#/components/correlationIds/default" + }, + "bindings": { + "$ref": "#/components/messageBindings/user" + }, + "examples": [] + }, + "userSignedUp": { + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + }, + "userSignedUpReply": { + "name": "UserSignupReply", + "title": "User signup reply", + "summary": "User signup reply message", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + }, + "userCompletedOrder": { + "summary": "User completed order event", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The ID of the order" + }, + "userId": { + "type": "string", + "description": "The ID of the user" + }, + "amount": { + "type": "number", + "description": "The total amount of the order" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "channel": { + "$ref": "#/channels/user" + }, + "bindings": { + "$ref": "#/components/operationBindings/sendUser" + }, + "traits": [ + { + "$ref": "#/components/operationTraits/binding" + } + ], + "reply": { + "$ref": "#/components/replies/signupReply" + } + } + }, + "replies": { + "signupReply": { + "address": { + "$ref": "#/components/replyAddresses/signupReply" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + } + } + }, + "replyAddresses": { + "signupReply": { + "location": "$message.header#/replyTo" + } + }, + "securitySchemes": { + "oauth": { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/token", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic", + "write:pets": "modify pets in your account", + "read:pets": "read your pets" + }, + "authorizationUrl": "https://example.com/api/oauth/dialog" + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + }, + "operationTraits": { + "binding": { + "bindings": { + "amqp": { + "ack": false + } + } + }, + "kafka": { + "bindings": { + "kafka": { + "groupId": false + } + } + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + }, + "tags": { + "user": { + "name": "user", + "description": "User-related messages" + } + }, + "externalDocs": { + "infoDocs": { + "url": "https://example.com/docs", + "description": "Find more info here" + } + }, + "serverBindings": { + "devAmqp": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "channelBindings": { + "user": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + } + }, + "operationBindings": { + "sendUser": { + "amqp": { + "ack": false + } + } + }, + "messageBindings": { + "user": { + "amqp": { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + } + } + } +} \ No newline at end of file diff --git a/scripts/validation/updated-docs/Security-Scheme-Object---API-key-auth.json b/scripts/validation/updated-docs/Security-Scheme-Object---API-key-auth.json new file mode 100644 index 00000000..db223349 --- /dev/null +++ b/scripts/validation/updated-docs/Security-Scheme-Object---API-key-auth.json @@ -0,0 +1,648 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "AsyncAPI", + "version": "1.x.x", + "description": "This is a very good base doc, probably.", + "termsOfService": "https://asyncapi.org/terms/", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ] + }, + "servers": { + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Production RabbitMQ broker (uses the `production` vhost).", + "title": "Production Server", + "summary": "Production environment server", + "security": [ + { + "type": "http", + "scheme": "bearer" + } + ], + "tags": [ + { + "name": "production", + "description": "Production environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the production server", + "url": "https://example.com/docs/production" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "staging": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Staging RabbitMQ broker (uses the `staging` vhost).", + "title": "Staging Server", + "summary": "Staging environment server", + "security": [ + { + "type": "apiKey", + "in": "user", + "description": "Provide your API key as the user and leave the password empty." + } + ], + "tags": [ + { + "name": "staging", + "description": "Staging environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the staging server", + "url": "https://example.com/docs/staging" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + }, + "userCompletedOrder": { + "$ref": "#/components/messages/userCompletedOrder" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/servers/production" + } + ], + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + }, + "tags": [ + { + "name": "user", + "description": "User-related messages" + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + }, + "userSignup": { + "address": "users.signup", + "description": "Channel for user signups", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + }, + "userSignupReply": { + "address": "users.signup.reply", + "description": "Channel for user signup replies", + "messages": { + "userSignedUpReply": { + "summary": "User signup reply message", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + } + } + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/user" + }, + "security": [ + { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "messages": [ + { + "$ref": "#/channels/user/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "#/channels/userSignupReply/messages/userSignedUpReply" + } + ] + } + } + }, + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type": "record", + "name": "UserCreate", + "namespace": "com.example", + "fields": [ + { + "name": "id", + "type": "int" + }, + { + "name": "name", + "type": "string" + } + ] + } + }, + "userCreate": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the user" + }, + "name": { + "type": "string", + "description": "The name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "The email of the user" + } + }, + "required": [ + "id", + "name", + "email" + ] + }, + "signup": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the signup" + }, + "source": { + "type": "string", + "description": "The source of the signup" + } + }, + "required": [ + "timestamp", + "source" + ] + }, + "ComplexModel": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "zip": { + "type": "string" + } + } + }, + "ErrorModel": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } + } + }, + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "RabbitMQ broker", + "bindings": { + "$ref": "#/components/serverBindings/devAmqp" + }, + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + } + }, + "security": [ + { + "$ref": "#/components/securitySchemes/oauth" + } + ] + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider in this example of `mycompany.com`" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignUp" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/components/servers/development" + } + ], + "bindings": { + "$ref": "#/components/channelBindings/user" + }, + "tags": [ + { + "$ref": "#/components/tags/user" + } + ], + "externalDocs": { + "$ref": "#/components/externalDocs/infoDocs" + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "payload": { + "$ref": "#/components/schemas/Category" + }, + "correlationId": { + "$ref": "#/components/correlationIds/default" + }, + "bindings": { + "$ref": "#/components/messageBindings/user" + } + }, + "userSignedUp": { + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + }, + "userCompletedOrder": { + "summary": "User completed order event", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The ID of the order" + }, + "userId": { + "type": "string", + "description": "The ID of the user" + }, + "amount": { + "type": "number", + "description": "The total amount of the order" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "channel": { + "$ref": "#/channels/user" + }, + "bindings": { + "$ref": "#/components/operationBindings/sendUser" + }, + "traits": [ + { + "$ref": "#/components/operationTraits/binding" + } + ], + "reply": { + "$ref": "#/components/replies/signupReply" + } + } + }, + "replies": { + "signupReply": { + "address": { + "$ref": "#/components/replyAddresses/signupReply" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + } + } + }, + "replyAddresses": { + "signupReply": { + "location": "$message.header#/replyTo" + } + }, + "securitySchemes": { + "oauth": { + "type": "apiKey", + "description": "The oauth security descriptions", + "in": "user" + } + }, + "operationTraits": { + "binding": { + "bindings": { + "amqp": { + "ack": false + } + } + }, + "kafka": { + "bindings": { + "kafka": { + "groupId": false + } + } + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + }, + "tags": { + "user": { + "name": "user", + "description": "User-related messages" + } + }, + "externalDocs": { + "infoDocs": { + "url": "https://example.com/docs", + "description": "Find more info here" + } + }, + "serverBindings": { + "devAmqp": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "channelBindings": { + "user": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + } + }, + "operationBindings": { + "sendUser": { + "amqp": { + "ack": false + } + } + }, + "messageBindings": { + "user": { + "amqp": { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + } + } + } +} \ No newline at end of file diff --git a/scripts/validation/updated-docs/Security-Scheme-Object---API-key.json b/scripts/validation/updated-docs/Security-Scheme-Object---API-key.json new file mode 100644 index 00000000..2d0a1e15 --- /dev/null +++ b/scripts/validation/updated-docs/Security-Scheme-Object---API-key.json @@ -0,0 +1,649 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "AsyncAPI", + "version": "1.x.x", + "description": "This is a very good base doc, probably.", + "termsOfService": "https://asyncapi.org/terms/", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ] + }, + "servers": { + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Production RabbitMQ broker (uses the `production` vhost).", + "title": "Production Server", + "summary": "Production environment server", + "security": [ + { + "type": "http", + "scheme": "bearer" + } + ], + "tags": [ + { + "name": "production", + "description": "Production environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the production server", + "url": "https://example.com/docs/production" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "staging": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Staging RabbitMQ broker (uses the `staging` vhost).", + "title": "Staging Server", + "summary": "Staging environment server", + "security": [ + { + "type": "apiKey", + "in": "user", + "description": "Provide your API key as the user and leave the password empty." + } + ], + "tags": [ + { + "name": "staging", + "description": "Staging environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the staging server", + "url": "https://example.com/docs/staging" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + }, + "userCompletedOrder": { + "$ref": "#/components/messages/userCompletedOrder" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/servers/production" + } + ], + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + }, + "tags": [ + { + "name": "user", + "description": "User-related messages" + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + }, + "userSignup": { + "address": "users.signup", + "description": "Channel for user signups", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + }, + "userSignupReply": { + "address": "users.signup.reply", + "description": "Channel for user signup replies", + "messages": { + "userSignedUpReply": { + "summary": "User signup reply message", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + } + } + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/user" + }, + "security": [ + { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "messages": [ + { + "$ref": "#/channels/user/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "#/channels/userSignupReply/messages/userSignedUpReply" + } + ] + } + } + }, + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type": "record", + "name": "UserCreate", + "namespace": "com.example", + "fields": [ + { + "name": "id", + "type": "int" + }, + { + "name": "name", + "type": "string" + } + ] + } + }, + "userCreate": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the user" + }, + "name": { + "type": "string", + "description": "The name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "The email of the user" + } + }, + "required": [ + "id", + "name", + "email" + ] + }, + "signup": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the signup" + }, + "source": { + "type": "string", + "description": "The source of the signup" + } + }, + "required": [ + "timestamp", + "source" + ] + }, + "ComplexModel": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "zip": { + "type": "string" + } + } + }, + "ErrorModel": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } + } + }, + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "RabbitMQ broker", + "bindings": { + "$ref": "#/components/serverBindings/devAmqp" + }, + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + } + }, + "security": [ + { + "$ref": "#/components/securitySchemes/oauth" + } + ] + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider in this example of `mycompany.com`" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignUp" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/components/servers/development" + } + ], + "bindings": { + "$ref": "#/components/channelBindings/user" + }, + "tags": [ + { + "$ref": "#/components/tags/user" + } + ], + "externalDocs": { + "$ref": "#/components/externalDocs/infoDocs" + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "payload": { + "$ref": "#/components/schemas/Category" + }, + "correlationId": { + "$ref": "#/components/correlationIds/default" + }, + "bindings": { + "$ref": "#/components/messageBindings/user" + } + }, + "userSignedUp": { + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + }, + "userCompletedOrder": { + "summary": "User completed order event", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The ID of the order" + }, + "userId": { + "type": "string", + "description": "The ID of the user" + }, + "amount": { + "type": "number", + "description": "The total amount of the order" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "channel": { + "$ref": "#/channels/user" + }, + "bindings": { + "$ref": "#/components/operationBindings/sendUser" + }, + "traits": [ + { + "$ref": "#/components/operationTraits/binding" + } + ], + "reply": { + "$ref": "#/components/replies/signupReply" + } + } + }, + "replies": { + "signupReply": { + "address": { + "$ref": "#/components/replyAddresses/signupReply" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + } + } + }, + "replyAddresses": { + "signupReply": { + "location": "$message.header#/replyTo" + } + }, + "securitySchemes": { + "oauth": { + "type": "httpApiKey", + "description": "The oauth security descriptions", + "name": "api_key", + "in": "header" + } + }, + "operationTraits": { + "binding": { + "bindings": { + "amqp": { + "ack": false + } + } + }, + "kafka": { + "bindings": { + "kafka": { + "groupId": false + } + } + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + }, + "tags": { + "user": { + "name": "user", + "description": "User-related messages" + } + }, + "externalDocs": { + "infoDocs": { + "url": "https://example.com/docs", + "description": "Find more info here" + } + }, + "serverBindings": { + "devAmqp": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "channelBindings": { + "user": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + } + }, + "operationBindings": { + "sendUser": { + "amqp": { + "ack": false + } + } + }, + "messageBindings": { + "user": { + "amqp": { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + } + } + } +} \ No newline at end of file diff --git a/scripts/validation/updated-docs/Security-Scheme-Object---JWT.json b/scripts/validation/updated-docs/Security-Scheme-Object---JWT.json new file mode 100644 index 00000000..94c1dbcf --- /dev/null +++ b/scripts/validation/updated-docs/Security-Scheme-Object---JWT.json @@ -0,0 +1,649 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "AsyncAPI", + "version": "1.x.x", + "description": "This is a very good base doc, probably.", + "termsOfService": "https://asyncapi.org/terms/", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ] + }, + "servers": { + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Production RabbitMQ broker (uses the `production` vhost).", + "title": "Production Server", + "summary": "Production environment server", + "security": [ + { + "type": "http", + "scheme": "bearer" + } + ], + "tags": [ + { + "name": "production", + "description": "Production environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the production server", + "url": "https://example.com/docs/production" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "staging": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Staging RabbitMQ broker (uses the `staging` vhost).", + "title": "Staging Server", + "summary": "Staging environment server", + "security": [ + { + "type": "apiKey", + "in": "user", + "description": "Provide your API key as the user and leave the password empty." + } + ], + "tags": [ + { + "name": "staging", + "description": "Staging environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the staging server", + "url": "https://example.com/docs/staging" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + }, + "userCompletedOrder": { + "$ref": "#/components/messages/userCompletedOrder" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/servers/production" + } + ], + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + }, + "tags": [ + { + "name": "user", + "description": "User-related messages" + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + }, + "userSignup": { + "address": "users.signup", + "description": "Channel for user signups", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + }, + "userSignupReply": { + "address": "users.signup.reply", + "description": "Channel for user signup replies", + "messages": { + "userSignedUpReply": { + "summary": "User signup reply message", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + } + } + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/user" + }, + "security": [ + { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "messages": [ + { + "$ref": "#/channels/user/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "#/channels/userSignupReply/messages/userSignedUpReply" + } + ] + } + } + }, + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type": "record", + "name": "UserCreate", + "namespace": "com.example", + "fields": [ + { + "name": "id", + "type": "int" + }, + { + "name": "name", + "type": "string" + } + ] + } + }, + "userCreate": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the user" + }, + "name": { + "type": "string", + "description": "The name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "The email of the user" + } + }, + "required": [ + "id", + "name", + "email" + ] + }, + "signup": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the signup" + }, + "source": { + "type": "string", + "description": "The source of the signup" + } + }, + "required": [ + "timestamp", + "source" + ] + }, + "ComplexModel": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "zip": { + "type": "string" + } + } + }, + "ErrorModel": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } + } + }, + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "RabbitMQ broker", + "bindings": { + "$ref": "#/components/serverBindings/devAmqp" + }, + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + } + }, + "security": [ + { + "$ref": "#/components/securitySchemes/oauth" + } + ] + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider in this example of `mycompany.com`" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignUp" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/components/servers/development" + } + ], + "bindings": { + "$ref": "#/components/channelBindings/user" + }, + "tags": [ + { + "$ref": "#/components/tags/user" + } + ], + "externalDocs": { + "$ref": "#/components/externalDocs/infoDocs" + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "payload": { + "$ref": "#/components/schemas/Category" + }, + "correlationId": { + "$ref": "#/components/correlationIds/default" + }, + "bindings": { + "$ref": "#/components/messageBindings/user" + } + }, + "userSignedUp": { + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + }, + "userCompletedOrder": { + "summary": "User completed order event", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The ID of the order" + }, + "userId": { + "type": "string", + "description": "The ID of the user" + }, + "amount": { + "type": "number", + "description": "The total amount of the order" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "channel": { + "$ref": "#/channels/user" + }, + "bindings": { + "$ref": "#/components/operationBindings/sendUser" + }, + "traits": [ + { + "$ref": "#/components/operationTraits/binding" + } + ], + "reply": { + "$ref": "#/components/replies/signupReply" + } + } + }, + "replies": { + "signupReply": { + "address": { + "$ref": "#/components/replyAddresses/signupReply" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + } + } + }, + "replyAddresses": { + "signupReply": { + "location": "$message.header#/replyTo" + } + }, + "securitySchemes": { + "oauth": { + "type": "http", + "description": "The oauth security descriptions", + "scheme": "bearer", + "bearerFormat": "JWT" + } + }, + "operationTraits": { + "binding": { + "bindings": { + "amqp": { + "ack": false + } + } + }, + "kafka": { + "bindings": { + "kafka": { + "groupId": false + } + } + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + }, + "tags": { + "user": { + "name": "user", + "description": "User-related messages" + } + }, + "externalDocs": { + "infoDocs": { + "url": "https://example.com/docs", + "description": "Find more info here" + } + }, + "serverBindings": { + "devAmqp": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "channelBindings": { + "user": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + } + }, + "operationBindings": { + "sendUser": { + "amqp": { + "ack": false + } + } + }, + "messageBindings": { + "user": { + "amqp": { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + } + } + } +} \ No newline at end of file diff --git a/scripts/validation/updated-docs/Security-Scheme-Object---SASL.json b/scripts/validation/updated-docs/Security-Scheme-Object---SASL.json new file mode 100644 index 00000000..207899a2 --- /dev/null +++ b/scripts/validation/updated-docs/Security-Scheme-Object---SASL.json @@ -0,0 +1,647 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "AsyncAPI", + "version": "1.x.x", + "description": "This is a very good base doc, probably.", + "termsOfService": "https://asyncapi.org/terms/", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ] + }, + "servers": { + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Production RabbitMQ broker (uses the `production` vhost).", + "title": "Production Server", + "summary": "Production environment server", + "security": [ + { + "type": "http", + "scheme": "bearer" + } + ], + "tags": [ + { + "name": "production", + "description": "Production environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the production server", + "url": "https://example.com/docs/production" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "staging": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Staging RabbitMQ broker (uses the `staging` vhost).", + "title": "Staging Server", + "summary": "Staging environment server", + "security": [ + { + "type": "apiKey", + "in": "user", + "description": "Provide your API key as the user and leave the password empty." + } + ], + "tags": [ + { + "name": "staging", + "description": "Staging environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the staging server", + "url": "https://example.com/docs/staging" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + }, + "userCompletedOrder": { + "$ref": "#/components/messages/userCompletedOrder" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/servers/production" + } + ], + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + }, + "tags": [ + { + "name": "user", + "description": "User-related messages" + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + }, + "userSignup": { + "address": "users.signup", + "description": "Channel for user signups", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + }, + "userSignupReply": { + "address": "users.signup.reply", + "description": "Channel for user signup replies", + "messages": { + "userSignedUpReply": { + "summary": "User signup reply message", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + } + } + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/user" + }, + "security": [ + { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "messages": [ + { + "$ref": "#/channels/user/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "#/channels/userSignupReply/messages/userSignedUpReply" + } + ] + } + } + }, + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type": "record", + "name": "UserCreate", + "namespace": "com.example", + "fields": [ + { + "name": "id", + "type": "int" + }, + { + "name": "name", + "type": "string" + } + ] + } + }, + "userCreate": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the user" + }, + "name": { + "type": "string", + "description": "The name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "The email of the user" + } + }, + "required": [ + "id", + "name", + "email" + ] + }, + "signup": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the signup" + }, + "source": { + "type": "string", + "description": "The source of the signup" + } + }, + "required": [ + "timestamp", + "source" + ] + }, + "ComplexModel": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "zip": { + "type": "string" + } + } + }, + "ErrorModel": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } + } + }, + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "RabbitMQ broker", + "bindings": { + "$ref": "#/components/serverBindings/devAmqp" + }, + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + } + }, + "security": [ + { + "$ref": "#/components/securitySchemes/oauth" + } + ] + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider in this example of `mycompany.com`" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignUp" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/components/servers/development" + } + ], + "bindings": { + "$ref": "#/components/channelBindings/user" + }, + "tags": [ + { + "$ref": "#/components/tags/user" + } + ], + "externalDocs": { + "$ref": "#/components/externalDocs/infoDocs" + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "payload": { + "$ref": "#/components/schemas/Category" + }, + "correlationId": { + "$ref": "#/components/correlationIds/default" + }, + "bindings": { + "$ref": "#/components/messageBindings/user" + } + }, + "userSignedUp": { + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + }, + "userCompletedOrder": { + "summary": "User completed order event", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The ID of the order" + }, + "userId": { + "type": "string", + "description": "The ID of the user" + }, + "amount": { + "type": "number", + "description": "The total amount of the order" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "channel": { + "$ref": "#/channels/user" + }, + "bindings": { + "$ref": "#/components/operationBindings/sendUser" + }, + "traits": [ + { + "$ref": "#/components/operationTraits/binding" + } + ], + "reply": { + "$ref": "#/components/replies/signupReply" + } + } + }, + "replies": { + "signupReply": { + "address": { + "$ref": "#/components/replyAddresses/signupReply" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + } + } + }, + "replyAddresses": { + "signupReply": { + "location": "$message.header#/replyTo" + } + }, + "securitySchemes": { + "oauth": { + "type": "scramSha512", + "description": "The oauth security descriptions" + } + }, + "operationTraits": { + "binding": { + "bindings": { + "amqp": { + "ack": false + } + } + }, + "kafka": { + "bindings": { + "kafka": { + "groupId": false + } + } + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + }, + "tags": { + "user": { + "name": "user", + "description": "User-related messages" + } + }, + "externalDocs": { + "infoDocs": { + "url": "https://example.com/docs", + "description": "Find more info here" + } + }, + "serverBindings": { + "devAmqp": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "channelBindings": { + "user": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + } + }, + "operationBindings": { + "sendUser": { + "amqp": { + "ack": false + } + } + }, + "messageBindings": { + "user": { + "amqp": { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + } + } + } +} \ No newline at end of file diff --git a/scripts/validation/updated-docs/Security-Scheme-Object---X509.json b/scripts/validation/updated-docs/Security-Scheme-Object---X509.json new file mode 100644 index 00000000..cf99803e --- /dev/null +++ b/scripts/validation/updated-docs/Security-Scheme-Object---X509.json @@ -0,0 +1,647 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "AsyncAPI", + "version": "1.x.x", + "description": "This is a very good base doc, probably.", + "termsOfService": "https://asyncapi.org/terms/", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ] + }, + "servers": { + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Production RabbitMQ broker (uses the `production` vhost).", + "title": "Production Server", + "summary": "Production environment server", + "security": [ + { + "type": "http", + "scheme": "bearer" + } + ], + "tags": [ + { + "name": "production", + "description": "Production environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the production server", + "url": "https://example.com/docs/production" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "staging": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Staging RabbitMQ broker (uses the `staging` vhost).", + "title": "Staging Server", + "summary": "Staging environment server", + "security": [ + { + "type": "apiKey", + "in": "user", + "description": "Provide your API key as the user and leave the password empty." + } + ], + "tags": [ + { + "name": "staging", + "description": "Staging environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the staging server", + "url": "https://example.com/docs/staging" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + }, + "userCompletedOrder": { + "$ref": "#/components/messages/userCompletedOrder" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/servers/production" + } + ], + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + }, + "tags": [ + { + "name": "user", + "description": "User-related messages" + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + }, + "userSignup": { + "address": "users.signup", + "description": "Channel for user signups", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + }, + "userSignupReply": { + "address": "users.signup.reply", + "description": "Channel for user signup replies", + "messages": { + "userSignedUpReply": { + "summary": "User signup reply message", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + } + } + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/user" + }, + "security": [ + { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "messages": [ + { + "$ref": "#/channels/user/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "#/channels/userSignupReply/messages/userSignedUpReply" + } + ] + } + } + }, + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type": "record", + "name": "UserCreate", + "namespace": "com.example", + "fields": [ + { + "name": "id", + "type": "int" + }, + { + "name": "name", + "type": "string" + } + ] + } + }, + "userCreate": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the user" + }, + "name": { + "type": "string", + "description": "The name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "The email of the user" + } + }, + "required": [ + "id", + "name", + "email" + ] + }, + "signup": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the signup" + }, + "source": { + "type": "string", + "description": "The source of the signup" + } + }, + "required": [ + "timestamp", + "source" + ] + }, + "ComplexModel": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "zip": { + "type": "string" + } + } + }, + "ErrorModel": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } + } + }, + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "RabbitMQ broker", + "bindings": { + "$ref": "#/components/serverBindings/devAmqp" + }, + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + } + }, + "security": [ + { + "$ref": "#/components/securitySchemes/oauth" + } + ] + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider in this example of `mycompany.com`" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignUp" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/components/servers/development" + } + ], + "bindings": { + "$ref": "#/components/channelBindings/user" + }, + "tags": [ + { + "$ref": "#/components/tags/user" + } + ], + "externalDocs": { + "$ref": "#/components/externalDocs/infoDocs" + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "payload": { + "$ref": "#/components/schemas/Category" + }, + "correlationId": { + "$ref": "#/components/correlationIds/default" + }, + "bindings": { + "$ref": "#/components/messageBindings/user" + } + }, + "userSignedUp": { + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + }, + "userCompletedOrder": { + "summary": "User completed order event", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The ID of the order" + }, + "userId": { + "type": "string", + "description": "The ID of the user" + }, + "amount": { + "type": "number", + "description": "The total amount of the order" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "channel": { + "$ref": "#/channels/user" + }, + "bindings": { + "$ref": "#/components/operationBindings/sendUser" + }, + "traits": [ + { + "$ref": "#/components/operationTraits/binding" + } + ], + "reply": { + "$ref": "#/components/replies/signupReply" + } + } + }, + "replies": { + "signupReply": { + "address": { + "$ref": "#/components/replyAddresses/signupReply" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + } + } + }, + "replyAddresses": { + "signupReply": { + "location": "$message.header#/replyTo" + } + }, + "securitySchemes": { + "oauth": { + "type": "X509", + "description": "The oauth security descriptions" + } + }, + "operationTraits": { + "binding": { + "bindings": { + "amqp": { + "ack": false + } + } + }, + "kafka": { + "bindings": { + "kafka": { + "groupId": false + } + } + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + }, + "tags": { + "user": { + "name": "user", + "description": "User-related messages" + } + }, + "externalDocs": { + "infoDocs": { + "url": "https://example.com/docs", + "description": "Find more info here" + } + }, + "serverBindings": { + "devAmqp": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "channelBindings": { + "user": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + } + }, + "operationBindings": { + "sendUser": { + "amqp": { + "ack": false + } + } + }, + "messageBindings": { + "user": { + "amqp": { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + } + } + } +} \ No newline at end of file diff --git a/scripts/validation/updated-docs/Security-Scheme-Object---basic.json b/scripts/validation/updated-docs/Security-Scheme-Object---basic.json new file mode 100644 index 00000000..4b415525 --- /dev/null +++ b/scripts/validation/updated-docs/Security-Scheme-Object---basic.json @@ -0,0 +1,648 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "AsyncAPI", + "version": "1.x.x", + "description": "This is a very good base doc, probably.", + "termsOfService": "https://asyncapi.org/terms/", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ] + }, + "servers": { + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Production RabbitMQ broker (uses the `production` vhost).", + "title": "Production Server", + "summary": "Production environment server", + "security": [ + { + "type": "http", + "scheme": "bearer" + } + ], + "tags": [ + { + "name": "production", + "description": "Production environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the production server", + "url": "https://example.com/docs/production" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "staging": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Staging RabbitMQ broker (uses the `staging` vhost).", + "title": "Staging Server", + "summary": "Staging environment server", + "security": [ + { + "type": "apiKey", + "in": "user", + "description": "Provide your API key as the user and leave the password empty." + } + ], + "tags": [ + { + "name": "staging", + "description": "Staging environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the staging server", + "url": "https://example.com/docs/staging" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + }, + "userCompletedOrder": { + "$ref": "#/components/messages/userCompletedOrder" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/servers/production" + } + ], + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + }, + "tags": [ + { + "name": "user", + "description": "User-related messages" + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + }, + "userSignup": { + "address": "users.signup", + "description": "Channel for user signups", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + }, + "userSignupReply": { + "address": "users.signup.reply", + "description": "Channel for user signup replies", + "messages": { + "userSignedUpReply": { + "summary": "User signup reply message", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + } + } + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/user" + }, + "security": [ + { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "messages": [ + { + "$ref": "#/channels/user/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "#/channels/userSignupReply/messages/userSignedUpReply" + } + ] + } + } + }, + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type": "record", + "name": "UserCreate", + "namespace": "com.example", + "fields": [ + { + "name": "id", + "type": "int" + }, + { + "name": "name", + "type": "string" + } + ] + } + }, + "userCreate": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the user" + }, + "name": { + "type": "string", + "description": "The name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "The email of the user" + } + }, + "required": [ + "id", + "name", + "email" + ] + }, + "signup": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the signup" + }, + "source": { + "type": "string", + "description": "The source of the signup" + } + }, + "required": [ + "timestamp", + "source" + ] + }, + "ComplexModel": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "zip": { + "type": "string" + } + } + }, + "ErrorModel": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } + } + }, + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "RabbitMQ broker", + "bindings": { + "$ref": "#/components/serverBindings/devAmqp" + }, + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + } + }, + "security": [ + { + "$ref": "#/components/securitySchemes/oauth" + } + ] + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider in this example of `mycompany.com`" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignUp" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/components/servers/development" + } + ], + "bindings": { + "$ref": "#/components/channelBindings/user" + }, + "tags": [ + { + "$ref": "#/components/tags/user" + } + ], + "externalDocs": { + "$ref": "#/components/externalDocs/infoDocs" + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "payload": { + "$ref": "#/components/schemas/Category" + }, + "correlationId": { + "$ref": "#/components/correlationIds/default" + }, + "bindings": { + "$ref": "#/components/messageBindings/user" + } + }, + "userSignedUp": { + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + }, + "userCompletedOrder": { + "summary": "User completed order event", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The ID of the order" + }, + "userId": { + "type": "string", + "description": "The ID of the user" + }, + "amount": { + "type": "number", + "description": "The total amount of the order" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "channel": { + "$ref": "#/channels/user" + }, + "bindings": { + "$ref": "#/components/operationBindings/sendUser" + }, + "traits": [ + { + "$ref": "#/components/operationTraits/binding" + } + ], + "reply": { + "$ref": "#/components/replies/signupReply" + } + } + }, + "replies": { + "signupReply": { + "address": { + "$ref": "#/components/replyAddresses/signupReply" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + } + } + }, + "replyAddresses": { + "signupReply": { + "location": "$message.header#/replyTo" + } + }, + "securitySchemes": { + "oauth": { + "type": "http", + "description": "The oauth security descriptions", + "scheme": "basic" + } + }, + "operationTraits": { + "binding": { + "bindings": { + "amqp": { + "ack": false + } + } + }, + "kafka": { + "bindings": { + "kafka": { + "groupId": false + } + } + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + }, + "tags": { + "user": { + "name": "user", + "description": "User-related messages" + } + }, + "externalDocs": { + "infoDocs": { + "url": "https://example.com/docs", + "description": "Find more info here" + } + }, + "serverBindings": { + "devAmqp": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "channelBindings": { + "user": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + } + }, + "operationBindings": { + "sendUser": { + "amqp": { + "ack": false + } + } + }, + "messageBindings": { + "user": { + "amqp": { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + } + } + } +} \ No newline at end of file diff --git a/scripts/validation/updated-docs/Security-Scheme-Object---end-to-end-encryption.json b/scripts/validation/updated-docs/Security-Scheme-Object---end-to-end-encryption.json new file mode 100644 index 00000000..d2d75cdb --- /dev/null +++ b/scripts/validation/updated-docs/Security-Scheme-Object---end-to-end-encryption.json @@ -0,0 +1,647 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "AsyncAPI", + "version": "1.x.x", + "description": "This is a very good base doc, probably.", + "termsOfService": "https://asyncapi.org/terms/", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ] + }, + "servers": { + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Production RabbitMQ broker (uses the `production` vhost).", + "title": "Production Server", + "summary": "Production environment server", + "security": [ + { + "type": "http", + "scheme": "bearer" + } + ], + "tags": [ + { + "name": "production", + "description": "Production environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the production server", + "url": "https://example.com/docs/production" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "staging": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Staging RabbitMQ broker (uses the `staging` vhost).", + "title": "Staging Server", + "summary": "Staging environment server", + "security": [ + { + "type": "apiKey", + "in": "user", + "description": "Provide your API key as the user and leave the password empty." + } + ], + "tags": [ + { + "name": "staging", + "description": "Staging environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the staging server", + "url": "https://example.com/docs/staging" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + }, + "userCompletedOrder": { + "$ref": "#/components/messages/userCompletedOrder" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/servers/production" + } + ], + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + }, + "tags": [ + { + "name": "user", + "description": "User-related messages" + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + }, + "userSignup": { + "address": "users.signup", + "description": "Channel for user signups", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + }, + "userSignupReply": { + "address": "users.signup.reply", + "description": "Channel for user signup replies", + "messages": { + "userSignedUpReply": { + "summary": "User signup reply message", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + } + } + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/user" + }, + "security": [ + { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "messages": [ + { + "$ref": "#/channels/user/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "#/channels/userSignupReply/messages/userSignedUpReply" + } + ] + } + } + }, + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type": "record", + "name": "UserCreate", + "namespace": "com.example", + "fields": [ + { + "name": "id", + "type": "int" + }, + { + "name": "name", + "type": "string" + } + ] + } + }, + "userCreate": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the user" + }, + "name": { + "type": "string", + "description": "The name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "The email of the user" + } + }, + "required": [ + "id", + "name", + "email" + ] + }, + "signup": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the signup" + }, + "source": { + "type": "string", + "description": "The source of the signup" + } + }, + "required": [ + "timestamp", + "source" + ] + }, + "ComplexModel": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "zip": { + "type": "string" + } + } + }, + "ErrorModel": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } + } + }, + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "RabbitMQ broker", + "bindings": { + "$ref": "#/components/serverBindings/devAmqp" + }, + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + } + }, + "security": [ + { + "$ref": "#/components/securitySchemes/oauth" + } + ] + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider in this example of `mycompany.com`" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignUp" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/components/servers/development" + } + ], + "bindings": { + "$ref": "#/components/channelBindings/user" + }, + "tags": [ + { + "$ref": "#/components/tags/user" + } + ], + "externalDocs": { + "$ref": "#/components/externalDocs/infoDocs" + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "payload": { + "$ref": "#/components/schemas/Category" + }, + "correlationId": { + "$ref": "#/components/correlationIds/default" + }, + "bindings": { + "$ref": "#/components/messageBindings/user" + } + }, + "userSignedUp": { + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + }, + "userCompletedOrder": { + "summary": "User completed order event", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The ID of the order" + }, + "userId": { + "type": "string", + "description": "The ID of the user" + }, + "amount": { + "type": "number", + "description": "The total amount of the order" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "channel": { + "$ref": "#/channels/user" + }, + "bindings": { + "$ref": "#/components/operationBindings/sendUser" + }, + "traits": [ + { + "$ref": "#/components/operationTraits/binding" + } + ], + "reply": { + "$ref": "#/components/replies/signupReply" + } + } + }, + "replies": { + "signupReply": { + "address": { + "$ref": "#/components/replyAddresses/signupReply" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + } + } + }, + "replyAddresses": { + "signupReply": { + "location": "$message.header#/replyTo" + } + }, + "securitySchemes": { + "oauth": { + "type": "symmetricEncryption", + "description": "The oauth security descriptions" + } + }, + "operationTraits": { + "binding": { + "bindings": { + "amqp": { + "ack": false + } + } + }, + "kafka": { + "bindings": { + "kafka": { + "groupId": false + } + } + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + }, + "tags": { + "user": { + "name": "user", + "description": "User-related messages" + } + }, + "externalDocs": { + "infoDocs": { + "url": "https://example.com/docs", + "description": "Find more info here" + } + }, + "serverBindings": { + "devAmqp": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "channelBindings": { + "user": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + } + }, + "operationBindings": { + "sendUser": { + "amqp": { + "ack": false + } + } + }, + "messageBindings": { + "user": { + "amqp": { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + } + } + } +} \ No newline at end of file diff --git a/scripts/validation/updated-docs/Security-Scheme-Object---implicity-OAuth2.json b/scripts/validation/updated-docs/Security-Scheme-Object---implicity-OAuth2.json new file mode 100644 index 00000000..8024f4c8 --- /dev/null +++ b/scripts/validation/updated-docs/Security-Scheme-Object---implicity-OAuth2.json @@ -0,0 +1,659 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "AsyncAPI", + "version": "1.x.x", + "description": "This is a very good base doc, probably.", + "termsOfService": "https://asyncapi.org/terms/", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ] + }, + "servers": { + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Production RabbitMQ broker (uses the `production` vhost).", + "title": "Production Server", + "summary": "Production environment server", + "security": [ + { + "type": "http", + "scheme": "bearer" + } + ], + "tags": [ + { + "name": "production", + "description": "Production environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the production server", + "url": "https://example.com/docs/production" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "staging": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Staging RabbitMQ broker (uses the `staging` vhost).", + "title": "Staging Server", + "summary": "Staging environment server", + "security": [ + { + "type": "apiKey", + "in": "user", + "description": "Provide your API key as the user and leave the password empty." + } + ], + "tags": [ + { + "name": "staging", + "description": "Staging environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the staging server", + "url": "https://example.com/docs/staging" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + }, + "userCompletedOrder": { + "$ref": "#/components/messages/userCompletedOrder" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/servers/production" + } + ], + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + }, + "tags": [ + { + "name": "user", + "description": "User-related messages" + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + }, + "userSignup": { + "address": "users.signup", + "description": "Channel for user signups", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + }, + "userSignupReply": { + "address": "users.signup.reply", + "description": "Channel for user signup replies", + "messages": { + "userSignedUpReply": { + "summary": "User signup reply message", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + } + } + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/user" + }, + "security": [ + { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "messages": [ + { + "$ref": "#/channels/user/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "#/channels/userSignupReply/messages/userSignedUpReply" + } + ] + } + } + }, + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type": "record", + "name": "UserCreate", + "namespace": "com.example", + "fields": [ + { + "name": "id", + "type": "int" + }, + { + "name": "name", + "type": "string" + } + ] + } + }, + "userCreate": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the user" + }, + "name": { + "type": "string", + "description": "The name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "The email of the user" + } + }, + "required": [ + "id", + "name", + "email" + ] + }, + "signup": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the signup" + }, + "source": { + "type": "string", + "description": "The source of the signup" + } + }, + "required": [ + "timestamp", + "source" + ] + }, + "ComplexModel": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "zip": { + "type": "string" + } + } + }, + "ErrorModel": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } + } + }, + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "RabbitMQ broker", + "bindings": { + "$ref": "#/components/serverBindings/devAmqp" + }, + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + } + }, + "security": [ + { + "$ref": "#/components/securitySchemes/oauth" + } + ] + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider in this example of `mycompany.com`" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignUp" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/components/servers/development" + } + ], + "bindings": { + "$ref": "#/components/channelBindings/user" + }, + "tags": [ + { + "$ref": "#/components/tags/user" + } + ], + "externalDocs": { + "$ref": "#/components/externalDocs/infoDocs" + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "payload": { + "$ref": "#/components/schemas/Category" + }, + "correlationId": { + "$ref": "#/components/correlationIds/default" + }, + "bindings": { + "$ref": "#/components/messageBindings/user" + } + }, + "userSignedUp": { + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + }, + "userCompletedOrder": { + "summary": "User completed order event", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The ID of the order" + }, + "userId": { + "type": "string", + "description": "The ID of the user" + }, + "amount": { + "type": "number", + "description": "The total amount of the order" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "channel": { + "$ref": "#/channels/user" + }, + "bindings": { + "$ref": "#/components/operationBindings/sendUser" + }, + "traits": [ + { + "$ref": "#/components/operationTraits/binding" + } + ], + "reply": { + "$ref": "#/components/replies/signupReply" + } + } + }, + "replies": { + "signupReply": { + "address": { + "$ref": "#/components/replyAddresses/signupReply" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + } + } + }, + "replyAddresses": { + "signupReply": { + "location": "$message.header#/replyTo" + } + }, + "securitySchemes": { + "oauth": { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "implicit": { + "authorizationUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "write:pets": "modify pets in your account", + "read:pets": "read your pets" + } + } + }, + "scopes": [ + "write:pets" + ] + } + }, + "operationTraits": { + "binding": { + "bindings": { + "amqp": { + "ack": false + } + } + }, + "kafka": { + "bindings": { + "kafka": { + "groupId": false + } + } + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + }, + "tags": { + "user": { + "name": "user", + "description": "User-related messages" + } + }, + "externalDocs": { + "infoDocs": { + "url": "https://example.com/docs", + "description": "Find more info here" + } + }, + "serverBindings": { + "devAmqp": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "channelBindings": { + "user": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + } + }, + "operationBindings": { + "sendUser": { + "amqp": { + "ack": false + } + } + }, + "messageBindings": { + "user": { + "amqp": { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + } + } + } +} \ No newline at end of file diff --git a/scripts/validation/updated-docs/Security-Scheme-Object---user-pass.json b/scripts/validation/updated-docs/Security-Scheme-Object---user-pass.json new file mode 100644 index 00000000..89ad3436 --- /dev/null +++ b/scripts/validation/updated-docs/Security-Scheme-Object---user-pass.json @@ -0,0 +1,647 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "AsyncAPI", + "version": "1.x.x", + "description": "This is a very good base doc, probably.", + "termsOfService": "https://asyncapi.org/terms/", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ] + }, + "servers": { + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Production RabbitMQ broker (uses the `production` vhost).", + "title": "Production Server", + "summary": "Production environment server", + "security": [ + { + "type": "http", + "scheme": "bearer" + } + ], + "tags": [ + { + "name": "production", + "description": "Production environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the production server", + "url": "https://example.com/docs/production" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "staging": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Staging RabbitMQ broker (uses the `staging` vhost).", + "title": "Staging Server", + "summary": "Staging environment server", + "security": [ + { + "type": "apiKey", + "in": "user", + "description": "Provide your API key as the user and leave the password empty." + } + ], + "tags": [ + { + "name": "staging", + "description": "Staging environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the staging server", + "url": "https://example.com/docs/staging" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + }, + "userCompletedOrder": { + "$ref": "#/components/messages/userCompletedOrder" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/servers/production" + } + ], + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + }, + "tags": [ + { + "name": "user", + "description": "User-related messages" + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + }, + "userSignup": { + "address": "users.signup", + "description": "Channel for user signups", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + }, + "userSignupReply": { + "address": "users.signup.reply", + "description": "Channel for user signup replies", + "messages": { + "userSignedUpReply": { + "summary": "User signup reply message", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + } + } + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/user" + }, + "security": [ + { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "messages": [ + { + "$ref": "#/channels/user/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "#/channels/userSignupReply/messages/userSignedUpReply" + } + ] + } + } + }, + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type": "record", + "name": "UserCreate", + "namespace": "com.example", + "fields": [ + { + "name": "id", + "type": "int" + }, + { + "name": "name", + "type": "string" + } + ] + } + }, + "userCreate": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the user" + }, + "name": { + "type": "string", + "description": "The name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "The email of the user" + } + }, + "required": [ + "id", + "name", + "email" + ] + }, + "signup": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the signup" + }, + "source": { + "type": "string", + "description": "The source of the signup" + } + }, + "required": [ + "timestamp", + "source" + ] + }, + "ComplexModel": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "zip": { + "type": "string" + } + } + }, + "ErrorModel": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } + } + }, + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "RabbitMQ broker", + "bindings": { + "$ref": "#/components/serverBindings/devAmqp" + }, + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + } + }, + "security": [ + { + "$ref": "#/components/securitySchemes/oauth" + } + ] + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider in this example of `mycompany.com`" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignUp" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/components/servers/development" + } + ], + "bindings": { + "$ref": "#/components/channelBindings/user" + }, + "tags": [ + { + "$ref": "#/components/tags/user" + } + ], + "externalDocs": { + "$ref": "#/components/externalDocs/infoDocs" + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "payload": { + "$ref": "#/components/schemas/Category" + }, + "correlationId": { + "$ref": "#/components/correlationIds/default" + }, + "bindings": { + "$ref": "#/components/messageBindings/user" + } + }, + "userSignedUp": { + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + }, + "userCompletedOrder": { + "summary": "User completed order event", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The ID of the order" + }, + "userId": { + "type": "string", + "description": "The ID of the user" + }, + "amount": { + "type": "number", + "description": "The total amount of the order" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "channel": { + "$ref": "#/channels/user" + }, + "bindings": { + "$ref": "#/components/operationBindings/sendUser" + }, + "traits": [ + { + "$ref": "#/components/operationTraits/binding" + } + ], + "reply": { + "$ref": "#/components/replies/signupReply" + } + } + }, + "replies": { + "signupReply": { + "address": { + "$ref": "#/components/replyAddresses/signupReply" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + } + } + }, + "replyAddresses": { + "signupReply": { + "location": "$message.header#/replyTo" + } + }, + "securitySchemes": { + "oauth": { + "type": "userPassword", + "description": "The oauth security descriptions" + } + }, + "operationTraits": { + "binding": { + "bindings": { + "amqp": { + "ack": false + } + } + }, + "kafka": { + "bindings": { + "kafka": { + "groupId": false + } + } + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + }, + "tags": { + "user": { + "name": "user", + "description": "User-related messages" + } + }, + "externalDocs": { + "infoDocs": { + "url": "https://example.com/docs", + "description": "Find more info here" + } + }, + "serverBindings": { + "devAmqp": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "channelBindings": { + "user": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + } + }, + "operationBindings": { + "sendUser": { + "amqp": { + "ack": false + } + } + }, + "messageBindings": { + "user": { + "amqp": { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + } + } + } +} \ No newline at end of file diff --git a/scripts/validation/updated-docs/Server-Object-with-Variable-Object.json b/scripts/validation/updated-docs/Server-Object-with-Variable-Object.json new file mode 100644 index 00000000..f3a35600 --- /dev/null +++ b/scripts/validation/updated-docs/Server-Object-with-Variable-Object.json @@ -0,0 +1,698 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "AsyncAPI", + "version": "1.x.x", + "description": "This is a very good base doc, probably.", + "termsOfService": "https://asyncapi.org/terms/", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ] + }, + "servers": { + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/{env}", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "RabbitMQ broker. Use the `env` variable to point to either `production` or `staging`.", + "title": "Production Server", + "summary": "Production environment server", + "security": [ + { + "type": "http", + "scheme": "bearer" + } + ], + "tags": [ + { + "name": "production", + "description": "Production environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the production server", + "url": "https://example.com/docs/production" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + }, + "variables": { + "env": { + "description": "Environment to connect to. It can be either `production` or `staging`.", + "enum": [ + "production", + "staging" + ] + } + } + }, + "staging": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Staging RabbitMQ broker (uses the `staging` vhost).", + "title": "Staging Server", + "summary": "Staging environment server", + "security": [ + { + "type": "apiKey", + "in": "user", + "description": "Provide your API key as the user and leave the password empty." + } + ], + "tags": [ + { + "name": "staging", + "description": "Staging environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the staging server", + "url": "https://example.com/docs/staging" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "rabbitmqInProd": { + "host": "{prod}.in.mycompany.com", + "protocol": "amqp", + "description": "Production server" + }, + "rabbitmqInStaging": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "Staging server" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + }, + "userCompletedOrder": { + "$ref": "#/components/messages/userCompletedOrder" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/servers/production" + } + ], + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + }, + "tags": [ + { + "name": "user", + "description": "User-related messages" + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + }, + "userSignup": { + "address": "users.signup", + "description": "Channel for user signups", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + }, + "userSignupReply": { + "address": "users.signup.reply", + "description": "Channel for user signup replies", + "messages": { + "userSignedUpReply": { + "summary": "User signup reply message", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + } + } + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/user" + }, + "security": [ + { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "messages": [ + { + "$ref": "#/channels/user/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "#/channels/userSignupReply/messages/userSignedUpReply" + } + ] + }, + "traits": [] + } + }, + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type": "record", + "name": "UserCreate", + "namespace": "com.example", + "fields": [ + { + "name": "id", + "type": "int" + }, + { + "name": "name", + "type": "string" + } + ] + } + }, + "userCreate": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the user" + }, + "name": { + "type": "string", + "description": "The name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "The email of the user" + } + }, + "required": [ + "id", + "name", + "email" + ] + }, + "signup": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the signup" + }, + "source": { + "type": "string", + "description": "The source of the signup" + } + }, + "required": [ + "timestamp", + "source" + ] + }, + "ComplexModel": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "zip": { + "type": "string" + } + } + }, + "ErrorModel": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } + } + }, + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "RabbitMQ broker", + "bindings": { + "$ref": "#/components/serverBindings/devAmqp" + }, + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + } + }, + "security": [ + { + "$ref": "#/components/securitySchemes/oauth" + } + ] + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider in this example of `mycompany.com`" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignUp" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/components/servers/development" + } + ], + "bindings": { + "$ref": "#/components/channelBindings/user" + }, + "tags": [ + { + "$ref": "#/components/tags/user" + } + ], + "externalDocs": { + "$ref": "#/components/externalDocs/infoDocs" + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "payload": { + "$ref": "#/components/schemas/Category" + }, + "correlationId": { + "$ref": "#/components/correlationIds/default" + }, + "bindings": { + "$ref": "#/components/messageBindings/user" + }, + "examples": [] + }, + "userSignedUp": { + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + }, + "userSignedUpReply": { + "name": "UserSignupReply", + "title": "User signup reply", + "summary": "User signup reply message", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + }, + "userCompletedOrder": { + "summary": "User completed order event", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The ID of the order" + }, + "userId": { + "type": "string", + "description": "The ID of the user" + }, + "amount": { + "type": "number", + "description": "The total amount of the order" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "channel": { + "$ref": "#/channels/user" + }, + "bindings": { + "$ref": "#/components/operationBindings/sendUser" + }, + "traits": [ + { + "$ref": "#/components/operationTraits/binding" + } + ], + "reply": { + "$ref": "#/components/replies/signupReply" + } + } + }, + "replies": { + "signupReply": { + "address": { + "$ref": "#/components/replyAddresses/signupReply" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + } + } + }, + "replyAddresses": { + "signupReply": { + "location": "$message.header#/replyTo" + } + }, + "securitySchemes": { + "oauth": { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + }, + "operationTraits": { + "binding": { + "bindings": { + "amqp": { + "ack": false + } + } + }, + "kafka": { + "bindings": { + "kafka": { + "groupId": false + } + } + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + }, + "tags": { + "user": { + "name": "user", + "description": "User-related messages" + } + }, + "externalDocs": { + "infoDocs": { + "url": "https://example.com/docs", + "description": "Find more info here" + } + }, + "serverBindings": { + "devAmqp": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "channelBindings": { + "user": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + } + }, + "operationBindings": { + "sendUser": { + "amqp": { + "ack": false + } + } + }, + "messageBindings": { + "user": { + "amqp": { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + } + } + } +} \ No newline at end of file diff --git a/scripts/validation/updated-docs/Server-Object-with-pathname.json b/scripts/validation/updated-docs/Server-Object-with-pathname.json new file mode 100644 index 00000000..8ae8ad54 --- /dev/null +++ b/scripts/validation/updated-docs/Server-Object-with-pathname.json @@ -0,0 +1,689 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "AsyncAPI", + "version": "1.x.x", + "description": "This is a very good base doc, probably.", + "termsOfService": "https://asyncapi.org/terms/", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ] + }, + "servers": { + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/production", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Production RabbitMQ broker (uses the `production` vhost).", + "title": "Production Server", + "summary": "Production environment server", + "security": [ + { + "type": "http", + "scheme": "bearer" + } + ], + "tags": [ + { + "name": "production", + "description": "Production environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the production server", + "url": "https://example.com/docs/production" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "staging": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Staging RabbitMQ broker (uses the `staging` vhost).", + "title": "Staging Server", + "summary": "Staging environment server", + "security": [ + { + "type": "apiKey", + "in": "user", + "description": "Provide your API key as the user and leave the password empty." + } + ], + "tags": [ + { + "name": "staging", + "description": "Staging environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the staging server", + "url": "https://example.com/docs/staging" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "rabbitmqInProd": { + "host": "{prod}.in.mycompany.com", + "protocol": "amqp", + "description": "Production server" + }, + "rabbitmqInStaging": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "Staging server" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + }, + "userCompletedOrder": { + "$ref": "#/components/messages/userCompletedOrder" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/servers/production" + } + ], + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + }, + "tags": [ + { + "name": "user", + "description": "User-related messages" + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + }, + "userSignup": { + "address": "users.signup", + "description": "Channel for user signups", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + }, + "userSignupReply": { + "address": "users.signup.reply", + "description": "Channel for user signup replies", + "messages": { + "userSignedUpReply": { + "summary": "User signup reply message", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + } + } + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/user" + }, + "security": [ + { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "messages": [ + { + "$ref": "#/channels/user/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "#/channels/userSignupReply/messages/userSignedUpReply" + } + ] + }, + "traits": [] + } + }, + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type": "record", + "name": "UserCreate", + "namespace": "com.example", + "fields": [ + { + "name": "id", + "type": "int" + }, + { + "name": "name", + "type": "string" + } + ] + } + }, + "userCreate": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the user" + }, + "name": { + "type": "string", + "description": "The name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "The email of the user" + } + }, + "required": [ + "id", + "name", + "email" + ] + }, + "signup": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the signup" + }, + "source": { + "type": "string", + "description": "The source of the signup" + } + }, + "required": [ + "timestamp", + "source" + ] + }, + "ComplexModel": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "zip": { + "type": "string" + } + } + }, + "ErrorModel": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } + } + }, + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "RabbitMQ broker", + "bindings": { + "$ref": "#/components/serverBindings/devAmqp" + }, + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + } + }, + "security": [ + { + "$ref": "#/components/securitySchemes/oauth" + } + ] + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider in this example of `mycompany.com`" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignUp" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/components/servers/development" + } + ], + "bindings": { + "$ref": "#/components/channelBindings/user" + }, + "tags": [ + { + "$ref": "#/components/tags/user" + } + ], + "externalDocs": { + "$ref": "#/components/externalDocs/infoDocs" + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "payload": { + "$ref": "#/components/schemas/Category" + }, + "correlationId": { + "$ref": "#/components/correlationIds/default" + }, + "bindings": { + "$ref": "#/components/messageBindings/user" + }, + "examples": [] + }, + "userSignedUp": { + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + }, + "userSignedUpReply": { + "name": "UserSignupReply", + "title": "User signup reply", + "summary": "User signup reply message", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + }, + "userCompletedOrder": { + "summary": "User completed order event", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The ID of the order" + }, + "userId": { + "type": "string", + "description": "The ID of the user" + }, + "amount": { + "type": "number", + "description": "The total amount of the order" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "channel": { + "$ref": "#/channels/user" + }, + "bindings": { + "$ref": "#/components/operationBindings/sendUser" + }, + "traits": [ + { + "$ref": "#/components/operationTraits/binding" + } + ], + "reply": { + "$ref": "#/components/replies/signupReply" + } + } + }, + "replies": { + "signupReply": { + "address": { + "$ref": "#/components/replyAddresses/signupReply" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + } + } + }, + "replyAddresses": { + "signupReply": { + "location": "$message.header#/replyTo" + } + }, + "securitySchemes": { + "oauth": { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + }, + "operationTraits": { + "binding": { + "bindings": { + "amqp": { + "ack": false + } + } + }, + "kafka": { + "bindings": { + "kafka": { + "groupId": false + } + } + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + }, + "tags": { + "user": { + "name": "user", + "description": "User-related messages" + } + }, + "externalDocs": { + "infoDocs": { + "url": "https://example.com/docs", + "description": "Find more info here" + } + }, + "serverBindings": { + "devAmqp": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "channelBindings": { + "user": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + } + }, + "operationBindings": { + "sendUser": { + "amqp": { + "ack": false + } + } + }, + "messageBindings": { + "user": { + "amqp": { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + } + } + } +} \ No newline at end of file diff --git a/scripts/validation/updated-docs/Server-Object.json b/scripts/validation/updated-docs/Server-Object.json new file mode 100644 index 00000000..a8f1c095 --- /dev/null +++ b/scripts/validation/updated-docs/Server-Object.json @@ -0,0 +1,689 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "AsyncAPI", + "version": "1.x.x", + "description": "This is a very good base doc, probably.", + "termsOfService": "https://asyncapi.org/terms/", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ] + }, + "servers": { + "production": { + "host": "kafka.in.mycompany.com:9092", + "pathname": "/v1", + "protocol": "kafka", + "protocolVersion": "3.2", + "description": "Production Kafka broker.", + "title": "Production Server", + "summary": "Production environment server", + "security": [ + { + "type": "http", + "scheme": "bearer" + } + ], + "tags": [ + { + "name": "production", + "description": "Production environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the production server", + "url": "https://example.com/docs/production" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "staging": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Staging RabbitMQ broker (uses the `staging` vhost).", + "title": "Staging Server", + "summary": "Staging environment server", + "security": [ + { + "type": "apiKey", + "in": "user", + "description": "Provide your API key as the user and leave the password empty." + } + ], + "tags": [ + { + "name": "staging", + "description": "Staging environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the staging server", + "url": "https://example.com/docs/staging" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "rabbitmqInProd": { + "host": "{prod}.in.mycompany.com", + "protocol": "amqp", + "description": "Production server" + }, + "rabbitmqInStaging": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "Staging server" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + }, + "userCompletedOrder": { + "$ref": "#/components/messages/userCompletedOrder" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/servers/production" + } + ], + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + }, + "tags": [ + { + "name": "user", + "description": "User-related messages" + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + }, + "userSignup": { + "address": "users.signup", + "description": "Channel for user signups", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + }, + "userSignupReply": { + "address": "users.signup.reply", + "description": "Channel for user signup replies", + "messages": { + "userSignedUpReply": { + "summary": "User signup reply message", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + } + } + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/user" + }, + "security": [ + { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "messages": [ + { + "$ref": "#/channels/user/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "#/channels/userSignupReply/messages/userSignedUpReply" + } + ] + }, + "traits": [] + } + }, + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type": "record", + "name": "UserCreate", + "namespace": "com.example", + "fields": [ + { + "name": "id", + "type": "int" + }, + { + "name": "name", + "type": "string" + } + ] + } + }, + "userCreate": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the user" + }, + "name": { + "type": "string", + "description": "The name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "The email of the user" + } + }, + "required": [ + "id", + "name", + "email" + ] + }, + "signup": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the signup" + }, + "source": { + "type": "string", + "description": "The source of the signup" + } + }, + "required": [ + "timestamp", + "source" + ] + }, + "ComplexModel": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "zip": { + "type": "string" + } + } + }, + "ErrorModel": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } + } + }, + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "RabbitMQ broker", + "bindings": { + "$ref": "#/components/serverBindings/devAmqp" + }, + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + } + }, + "security": [ + { + "$ref": "#/components/securitySchemes/oauth" + } + ] + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider in this example of `mycompany.com`" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignUp" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/components/servers/development" + } + ], + "bindings": { + "$ref": "#/components/channelBindings/user" + }, + "tags": [ + { + "$ref": "#/components/tags/user" + } + ], + "externalDocs": { + "$ref": "#/components/externalDocs/infoDocs" + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "payload": { + "$ref": "#/components/schemas/Category" + }, + "correlationId": { + "$ref": "#/components/correlationIds/default" + }, + "bindings": { + "$ref": "#/components/messageBindings/user" + }, + "examples": [] + }, + "userSignedUp": { + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + }, + "userSignedUpReply": { + "name": "UserSignupReply", + "title": "User signup reply", + "summary": "User signup reply message", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + }, + "userCompletedOrder": { + "summary": "User completed order event", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The ID of the order" + }, + "userId": { + "type": "string", + "description": "The ID of the user" + }, + "amount": { + "type": "number", + "description": "The total amount of the order" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "channel": { + "$ref": "#/channels/user" + }, + "bindings": { + "$ref": "#/components/operationBindings/sendUser" + }, + "traits": [ + { + "$ref": "#/components/operationTraits/binding" + } + ], + "reply": { + "$ref": "#/components/replies/signupReply" + } + } + }, + "replies": { + "signupReply": { + "address": { + "$ref": "#/components/replyAddresses/signupReply" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + } + } + }, + "replyAddresses": { + "signupReply": { + "location": "$message.header#/replyTo" + } + }, + "securitySchemes": { + "oauth": { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + }, + "operationTraits": { + "binding": { + "bindings": { + "amqp": { + "ack": false + } + } + }, + "kafka": { + "bindings": { + "kafka": { + "groupId": false + } + } + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + }, + "tags": { + "user": { + "name": "user", + "description": "User-related messages" + } + }, + "externalDocs": { + "infoDocs": { + "url": "https://example.com/docs", + "description": "Find more info here" + } + }, + "serverBindings": { + "devAmqp": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "channelBindings": { + "user": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + } + }, + "operationBindings": { + "sendUser": { + "amqp": { + "ack": false + } + } + }, + "messageBindings": { + "user": { + "amqp": { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + } + } + } +} \ No newline at end of file diff --git a/scripts/validation/updated-docs/Servers-Object.json b/scripts/validation/updated-docs/Servers-Object.json new file mode 100644 index 00000000..a04b6a1f --- /dev/null +++ b/scripts/validation/updated-docs/Servers-Object.json @@ -0,0 +1,701 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "AsyncAPI", + "version": "1.x.x", + "description": "This is a very good base doc, probably.", + "termsOfService": "https://asyncapi.org/terms/", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ] + }, + "servers": { + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "0-9-1", + "description": "RabbitMQ broker for the production environment.", + "title": "Production Server", + "summary": "Production environment server", + "security": [ + { + "type": "http", + "scheme": "bearer" + } + ], + "tags": [ + { + "name": "env:production", + "description": "This environment is the live environment available for final users." + } + ], + "externalDocs": { + "description": "Additional documentation for the production server", + "url": "https://example.com/docs/production" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "staging": { + "host": "rabbitmq-staging.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "0-9-1", + "description": "RabbitMQ broker for the staging environment.", + "title": "Staging Server", + "summary": "Staging environment server", + "security": [ + { + "type": "apiKey", + "in": "user", + "description": "Provide your API key as the user and leave the password empty." + } + ], + "tags": [ + { + "name": "env:staging", + "description": "This environment is a replica of the production environment." + } + ], + "externalDocs": { + "description": "Additional documentation for the staging server", + "url": "https://example.com/docs/staging" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "rabbitmqInProd": { + "host": "{prod}.in.mycompany.com", + "protocol": "amqp", + "description": "Production server" + }, + "rabbitmqInStaging": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "Staging server" + }, + "development": { + "host": "localhost:5672", + "description": "Development AMQP broker.", + "protocol": "amqp", + "protocolVersion": "0-9-1", + "tags": [ + { + "name": "env:development", + "description": "This environment is meant for developers to run their own tests." + } + ] + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + }, + "userCompletedOrder": { + "$ref": "#/components/messages/userCompletedOrder" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/servers/production" + } + ], + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + }, + "tags": [ + { + "name": "user", + "description": "User-related messages" + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + }, + "userSignup": { + "address": "users.signup", + "description": "Channel for user signups", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + }, + "userSignupReply": { + "address": "users.signup.reply", + "description": "Channel for user signup replies", + "messages": { + "userSignedUpReply": { + "summary": "User signup reply message", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + } + } + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/user" + }, + "security": [ + { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "messages": [ + { + "$ref": "#/channels/user/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "#/channels/userSignupReply/messages/userSignedUpReply" + } + ] + }, + "traits": [] + } + }, + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type": "record", + "name": "UserCreate", + "namespace": "com.example", + "fields": [ + { + "name": "id", + "type": "int" + }, + { + "name": "name", + "type": "string" + } + ] + } + }, + "userCreate": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the user" + }, + "name": { + "type": "string", + "description": "The name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "The email of the user" + } + }, + "required": [ + "id", + "name", + "email" + ] + }, + "signup": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the signup" + }, + "source": { + "type": "string", + "description": "The source of the signup" + } + }, + "required": [ + "timestamp", + "source" + ] + }, + "ComplexModel": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "zip": { + "type": "string" + } + } + }, + "ErrorModel": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } + } + }, + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "RabbitMQ broker", + "bindings": { + "$ref": "#/components/serverBindings/devAmqp" + }, + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + } + }, + "security": [ + { + "$ref": "#/components/securitySchemes/oauth" + } + ] + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider in this example of `mycompany.com`" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignUp" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/components/servers/development" + } + ], + "bindings": { + "$ref": "#/components/channelBindings/user" + }, + "tags": [ + { + "$ref": "#/components/tags/user" + } + ], + "externalDocs": { + "$ref": "#/components/externalDocs/infoDocs" + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "payload": { + "$ref": "#/components/schemas/Category" + }, + "correlationId": { + "$ref": "#/components/correlationIds/default" + }, + "bindings": { + "$ref": "#/components/messageBindings/user" + }, + "examples": [] + }, + "userSignedUp": { + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + }, + "userSignedUpReply": { + "name": "UserSignupReply", + "title": "User signup reply", + "summary": "User signup reply message", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + }, + "userCompletedOrder": { + "summary": "User completed order event", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The ID of the order" + }, + "userId": { + "type": "string", + "description": "The ID of the user" + }, + "amount": { + "type": "number", + "description": "The total amount of the order" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "channel": { + "$ref": "#/channels/user" + }, + "bindings": { + "$ref": "#/components/operationBindings/sendUser" + }, + "traits": [ + { + "$ref": "#/components/operationTraits/binding" + } + ], + "reply": { + "$ref": "#/components/replies/signupReply" + } + } + }, + "replies": { + "signupReply": { + "address": { + "$ref": "#/components/replyAddresses/signupReply" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + } + } + }, + "replyAddresses": { + "signupReply": { + "location": "$message.header#/replyTo" + } + }, + "securitySchemes": { + "oauth": { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + }, + "operationTraits": { + "binding": { + "bindings": { + "amqp": { + "ack": false + } + } + }, + "kafka": { + "bindings": { + "kafka": { + "groupId": false + } + } + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + }, + "tags": { + "user": { + "name": "user", + "description": "User-related messages" + } + }, + "externalDocs": { + "infoDocs": { + "url": "https://example.com/docs", + "description": "Find more info here" + } + }, + "serverBindings": { + "devAmqp": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "channelBindings": { + "user": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + } + }, + "operationBindings": { + "sendUser": { + "amqp": { + "ack": false + } + } + }, + "messageBindings": { + "user": { + "amqp": { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + } + } + } +} \ No newline at end of file diff --git a/scripts/validation/updated-docs/Tag-Object.json b/scripts/validation/updated-docs/Tag-Object.json new file mode 100644 index 00000000..0fecde4f --- /dev/null +++ b/scripts/validation/updated-docs/Tag-Object.json @@ -0,0 +1,689 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "AsyncAPI", + "version": "1.x.x", + "description": "This is a very good base doc, probably.", + "termsOfService": "https://asyncapi.org/terms/", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ] + }, + "servers": { + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Production RabbitMQ broker (uses the `production` vhost).", + "title": "Production Server", + "summary": "Production environment server", + "security": [ + { + "type": "http", + "scheme": "bearer" + } + ], + "tags": [ + { + "name": "production", + "description": "Production environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the production server", + "url": "https://example.com/docs/production" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "staging": { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/v1", + "protocol": "amqp", + "protocolVersion": "1.0", + "description": "Staging RabbitMQ broker (uses the `staging` vhost).", + "title": "Staging Server", + "summary": "Staging environment server", + "security": [ + { + "type": "apiKey", + "in": "user", + "description": "Provide your API key as the user and leave the password empty." + } + ], + "tags": [ + { + "name": "staging", + "description": "Staging environment" + } + ], + "externalDocs": { + "description": "Additional documentation for the staging server", + "url": "https://example.com/docs/staging" + }, + "bindings": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "rabbitmqInProd": { + "host": "{prod}.in.mycompany.com", + "protocol": "amqp", + "description": "Production server" + }, + "rabbitmqInStaging": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "Staging server" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + }, + "userCompletedOrder": { + "$ref": "#/components/messages/userCompletedOrder" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/servers/production" + } + ], + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + }, + "tags": [ + { + "name": "user", + "description": "User-related messages" + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + }, + "userSignup": { + "address": "users.signup", + "description": "Channel for user signups", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + }, + "userSignupReply": { + "address": "users.signup.reply", + "description": "Channel for user signup replies", + "messages": { + "userSignedUpReply": { + "summary": "User signup reply message", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + } + } + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/user" + }, + "security": [ + { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "messages": [ + { + "$ref": "#/channels/user/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "#/channels/userSignupReply/messages/userSignedUpReply" + } + ] + }, + "traits": [] + } + }, + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "type": "record", + "name": "UserCreate", + "namespace": "com.example", + "fields": [ + { + "name": "id", + "type": "int" + }, + { + "name": "name", + "type": "string" + } + ] + } + }, + "userCreate": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the user" + }, + "name": { + "type": "string", + "description": "The name of the user" + }, + "email": { + "type": "string", + "format": "email", + "description": "The email of the user" + } + }, + "required": [ + "id", + "name", + "email" + ] + }, + "signup": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the signup" + }, + "source": { + "type": "string", + "description": "The source of the signup" + } + }, + "required": [ + "timestamp", + "source" + ] + }, + "ComplexModel": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Address": { + "type": "object", + "properties": { + "street": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "zip": { + "type": "string" + } + } + }, + "ErrorModel": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } + } + }, + "Pet": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com", + "protocol": "amqp", + "description": "RabbitMQ broker", + "bindings": { + "$ref": "#/components/serverBindings/devAmqp" + }, + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + } + }, + "security": [ + { + "$ref": "#/components/securitySchemes/oauth" + } + ] + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider in this example of `mycompany.com`" + } + }, + "channels": { + "user": { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignUp" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/components/servers/development" + } + ], + "bindings": { + "$ref": "#/components/channelBindings/user" + }, + "tags": [ + { + "$ref": "#/components/tags/user" + } + ], + "externalDocs": { + "$ref": "#/components/externalDocs/infoDocs" + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "payload": { + "$ref": "#/components/schemas/Category" + }, + "correlationId": { + "$ref": "#/components/correlationIds/default" + }, + "bindings": { + "$ref": "#/components/messageBindings/user" + }, + "examples": [] + }, + "userSignedUp": { + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + }, + "userSignedUpReply": { + "name": "UserSignupReply", + "title": "User signup reply", + "summary": "User signup reply message", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Status of the signup process" + }, + "message": { + "type": "string", + "description": "Additional information" + } + } + } + }, + "userCompletedOrder": { + "summary": "User completed order event", + "contentType": "application/json", + "payload": { + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "The ID of the order" + }, + "userId": { + "type": "string", + "description": "The ID of the user" + }, + "amount": { + "type": "number", + "description": "The total amount of the order" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "operations": { + "sendUserSignUp": { + "action": "send", + "title": "User sign up", + "channel": { + "$ref": "#/channels/user" + }, + "bindings": { + "$ref": "#/components/operationBindings/sendUser" + }, + "traits": [ + { + "$ref": "#/components/operationTraits/binding" + } + ], + "reply": { + "$ref": "#/components/replies/signupReply" + } + } + }, + "replies": { + "signupReply": { + "address": { + "$ref": "#/components/replyAddresses/signupReply" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + } + } + }, + "replyAddresses": { + "signupReply": { + "location": "$message.header#/replyTo" + } + }, + "securitySchemes": { + "oauth": { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ] + } + }, + "operationTraits": { + "binding": { + "bindings": { + "amqp": { + "ack": false + } + } + }, + "kafka": { + "bindings": { + "kafka": { + "groupId": false + } + } + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + }, + "tags": { + "user": { + "name": "user", + "description": "User-related messages" + } + }, + "externalDocs": { + "infoDocs": { + "url": "https://example.com/docs", + "description": "Find more info here" + } + }, + "serverBindings": { + "devAmqp": { + "amqp": { + "exchange": "my-exchange", + "queue": "my-queue" + } + } + }, + "channelBindings": { + "user": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + } + }, + "operationBindings": { + "sendUser": { + "amqp": { + "ack": false + } + } + }, + "messageBindings": { + "user": { + "amqp": { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + } + } + } +} \ No newline at end of file diff --git a/spec/asyncapi.md b/spec/asyncapi.md index b15bc39e..a597c2dd 100644 --- a/spec/asyncapi.md +++ b/spec/asyncapi.md @@ -1422,7 +1422,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens ##### Message Example Object Example - + ```json { "name": "SimpleSignup",