From 0b724f5c29b7e106c4869b75c3c5fc242e6b296e Mon Sep 17 00:00:00 2001 From: Vladimir Gorej Date: Tue, 24 Dec 2024 14:06:12 +0100 Subject: [PATCH] docs(parser-adapter-openapi-json-3-0): adapt to OpenAPI 3.0.4 support Refs #4612 --- .../apidom-parser-adapter-openapi-json-3-0/README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/apidom-parser-adapter-openapi-json-3-0/README.md b/packages/apidom-parser-adapter-openapi-json-3-0/README.md index 74935ba606..cc45152b93 100644 --- a/packages/apidom-parser-adapter-openapi-json-3-0/README.md +++ b/packages/apidom-parser-adapter-openapi-json-3-0/README.md @@ -1,6 +1,6 @@ # @swagger-api/apidom-parser-adapter-openapi-json-3-0 -`@swagger-api/apidom-parser-adapter-openapi-json-3-0` is a parser adapter for the [OpenAPI 3.0.x specification](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md) in [JSON format](https://www.json.org/json-en.html). +`@swagger-api/apidom-parser-adapter-openapi-json-3-0` is a parser adapter for the [OpenAPI 3.0.x specification](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md) in [JSON format](https://www.json.org/json-en.html). Under the hood this adapter uses [apidom-parser-adapter-json](https://github.com/swagger-api/apidom/tree/main/packages/apidom-parser-adapter-json) to parse a source string into generic ApiDOM in [base ApiDOM namespace](https://github.com/swagger-api/apidom/tree/main/packages/apidom#base-namespace) which is then refracted with [OpenAPI 3.0.x Refractors](https://github.com/swagger-api/apidom/tree/main/packages/apidom-ns-openapi-3-0#refractors). @@ -33,6 +33,8 @@ Defines list of media types that this parser adapter recognizes. 'application/vnd.oai.openapi+json;version=3.0.2', 'application/vnd.oai.openapi;version=3.0.3', 'application/vnd.oai.openapi+json;version=3.0.3', + 'application/vnd.oai.openapi;version=3.0.4', + 'application/vnd.oai.openapi+json;version=3.0.4', ] ``` @@ -69,11 +71,11 @@ with [supported media types](#mediatypes). import { parse, detect } from '@swagger-api/apidom-parser-adapter-openapi-json-3-0'; // detecting -await detect('{"openapi": "3.0.3"}'); // => true +await detect('{"openapi": "3.0.4"}'); // => true await detect('test'); // => false // parsing -const parseResult = await parse('{"openapi": "3.0.3"}', { sourceMap: true }); +const parseResult = await parse('{"openapi": "3.0.4"}', { sourceMap: true }); ``` ### Indirect usage @@ -88,5 +90,5 @@ const parser = new ApiDOMParser(); parser.use(openApiJsonAdapter); -const parseResult = await parser.parse('{"openapi": "3.0.3"}', { mediaType: openApiJsonAdapter.mediaTypes.latest('json') }); +const parseResult = await parser.parse('{"openapi": "3.0.4"}', { mediaType: openApiJsonAdapter.mediaTypes.latest('json') }); ```