From 0b2215b54067f0c6ee0fed343b88a6eca057a199 Mon Sep 17 00:00:00 2001 From: Roberto Prevato Date: Fri, 6 Mar 2026 20:31:54 +0100 Subject: [PATCH 1/3] Group response codes in tab group on MkDocs output (issue #35) Each HTTP response code is now rendered as a pymdownx.tabbed tab (e.g. '=== "200 OK"') instead of a flat list, reducing vertical page length for APIs with many response codes. Content-type tabs are preserved nested inside each response tab. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../partial/request-responses.html | 103 +- tests/res/example1-output.md | 2078 ++++++++--------- tests/res/example2-output.md | 301 ++- tests/res/example3-output.md | 309 ++- tests/res/example4-split-output.md | 122 +- 5 files changed, 1378 insertions(+), 1535 deletions(-) diff --git a/openapidocs/mk/v3/views_mkdocs/partial/request-responses.html b/openapidocs/mk/v3/views_mkdocs/partial/request-responses.html index cfd00e1..e3a1503 100644 --- a/openapidocs/mk/v3/views_mkdocs/partial/request-responses.html +++ b/openapidocs/mk/v3/views_mkdocs/partial/request-responses.html @@ -1,63 +1,50 @@ {% for code, definition in operation.responses.items() %} - -

- {% if code == "default" -%} - {{texts.other_responses}} - {%- else -%} - Response {{code}} - {%- with phrase = get_http_status_phrase(code) -%} - {%- if phrase -%} -  {{ phrase }} - {%- endif -%} +=== "{% if code == "default" %}{{texts.other_responses}}{% else %}{{code}}{% with phrase = get_http_status_phrase(code) %}{% if phrase %} {{ phrase }}{% endif %}{% endwith %}{% endif %}" + {%- if is_reference(definition) -%} + {%- with type_name = definition["$ref"].replace("#/components/responses/", "") %} +

Refer to the common response description: {{type_name}}.

{%- endwith -%} - - {%- endif %} -

-{%- if is_reference(definition) -%} -{%- with type_name = definition["$ref"].replace("#/components/responses/", "") %} -

Refer to the common response description: {{type_name}}.

-{%- endwith -%} -{%- endif -%} -{%- if definition.content %} -{%- with content = handler.simplify_content(definition.content) %} -{% for content_type, definition in content.items() %} -=== "{{content_type}}" - {% include "partial/content-examples.html" %} - {% if "alt_types" in definition %}{{texts.other_possible_types}}: {{definition.alt_types | join(", ")}}{% endif %} + {%- endif -%} + {%- if definition.content %} + {%- with content = handler.simplify_content(definition.content) %} + {% for content_type, definition in content.items() %} + === "{{content_type}}" + {% include "partial/content-examples.html" %} + {% if "alt_types" in definition %}{{texts.other_possible_types}}: {{definition.alt_types | join(", ")}}{% endif %} - ??? hint "{{texts.schema_of_the_response_body}}" - ```json - {{handler.write_content_schema(definition) | indent(8) | safe}} - ``` -{% endfor %} -{% endwith -%} -{% endif -%} -{%- if definition.headers %} -
-

{{texts.response_headers}}

+ ??? hint "{{texts.schema_of_the_response_body}}" + ```json + {{handler.write_content_schema(definition) | indent(12) | safe}} + ``` + {% endfor %} + {% endwith -%} + {% endif -%} + {%- if definition.headers %} +
+

{{texts.response_headers}}

- - - - - - - - - - {%- for header_name, header_definition in definition.headers.items() %} - - - - - - {%- endfor %} - -
{{texts.name}}{{texts.description}}{{texts.schema}}
{{header_name}}{{header_definition.description}} - {%- with schema = header_definition.schema %} - {%- include "partial/schema-repr.html" -%} - {% endwith -%} -
-
-{% endif -%} + + + + + + + + + + {%- for header_name, header_definition in definition.headers.items() %} + + + + + + {%- endfor %} + +
{{texts.name}}{{texts.description}}{{texts.schema}}
{{header_name}}{{header_definition.description}} + {%- with schema = header_definition.schema %} + {%- include "partial/schema-repr.html" -%} + {% endwith -%} +
+
+ {% endif -%} {%- endfor -%} diff --git a/tests/res/example1-output.md b/tests/res/example1-output.md index 1f56d5c..d8514b3 100644 --- a/tests/res/example1-output.md +++ b/tests/res/example1-output.md @@ -124,13 +124,10 @@ Initializes a file upload operation. ``` - -

- Response 200 OK -

- -=== "application/json" +=== "200 OK" + === "application/json" + ```json { @@ -142,76 +139,70 @@ Initializes a file upload operation. ``` ⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information. - Other possible types: text/json, text/plain + Other possible types: text/json, text/plain - ??? hint "Schema of the response body" - ```json - { - "type": "object", - "properties": { - "baseURL": { - "type": "string", - "nullable": true - }, - "fileId": { - "type": "string", - "nullable": true - }, - "fileName": { - "type": "string", - "nullable": true + ??? hint "Schema of the response body" + ```json + { + "type": "object", + "properties": { + "baseURL": { + "type": "string", + "nullable": true + }, + "fileId": { + "type": "string", + "nullable": true + }, + "fileName": { + "type": "string", + "nullable": true + }, + "token": { + "type": "string", + "nullable": true + } }, - "token": { - "type": "string", - "nullable": true - } - }, - "additionalProperties": false - } - ``` - - -
-

Response headers

- - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionSchema
X-Rate-Limit-LimitThe number of allowed requests in the current periodinteger
X-Rate-Limit-RemainingThe number of remaining requests in the current periodinteger
X-Rate-Limit-ResetThe number of seconds left in the current periodinteger
-
- - -

- Response 400 Bad Request -

-

Refer to the common response description: IllegalInput.

- -

- Response 401 Unauthorized -

-

Refer to the common response description: Unauthorized.

+ "additionalProperties": false + } + ``` + + +
+

Response headers

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescriptionSchema
X-Rate-Limit-LimitThe number of allowed requests in the current periodinteger
X-Rate-Limit-RemainingThe number of remaining requests in the current periodinteger
X-Rate-Limit-ResetThe number of seconds left in the current periodinteger
+
+ +=== "400 Bad Request" +

Refer to the common response description: IllegalInput.

+=== "401 Unauthorized" +

Refer to the common response description: Unauthorized.

@@ -247,13 +238,10 @@ Gets the list of categories supported by the system. - -

- Response 200 OK -

- -=== "application/json" +=== "200 OK" + === "application/json" + ```json [ @@ -333,19 +321,19 @@ Gets the list of categories supported by the system. ``` ⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information. - Other possible types: text/json, text/plain + Other possible types: text/json, text/plain - ??? hint "Schema of the response body" - ```json - { - "type": "array", - "items": { - "$ref": "#/components/schemas/Category" + ??? hint "Schema of the response body" + ```json + { + "type": "array", + "items": { + "$ref": "#/components/schemas/Category" + } } - } - ``` - - + ``` + + @@ -382,13 +370,10 @@ codes. - -

- Response 200 OK -

- -=== "application/json" +=== "200 OK" + === "application/json" + ```json [ @@ -401,19 +386,19 @@ codes. ``` ⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information. - Other possible types: text/json, text/plain + Other possible types: text/json, text/plain - ??? hint "Schema of the response body" - ```json - { - "type": "array", - "items": { - "$ref": "#/components/schemas/Country" + ??? hint "Schema of the response body" + ```json + { + "type": "array", + "items": { + "$ref": "#/components/schemas/Country" + } } - } - ``` - - + ``` + +
@@ -446,13 +431,10 @@ ISO country codes. - -

- Response 200 OK -

- -=== "application/json" +=== "200 OK" + === "application/json" + ```json [ @@ -465,19 +447,19 @@ ISO country codes. ``` ⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information. - Other possible types: text/json, text/plain + Other possible types: text/json, text/plain - ??? hint "Schema of the response body" - ```json - { - "type": "array", - "items": { - "$ref": "#/components/schemas/Country" + ??? hint "Schema of the response body" + ```json + { + "type": "array", + "items": { + "$ref": "#/components/schemas/Country" + } } - } - ``` - - + ``` + + @@ -569,13 +551,10 @@ Gets a paginated set of downloads records. - -

- Response 200 OK -

- -=== "application/json" +=== "200 OK" + === "application/json" + ```json { @@ -666,30 +645,30 @@ Gets a paginated set of downloads records. ``` ⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information. - Other possible types: text/json, text/plain + Other possible types: text/json, text/plain - ??? hint "Schema of the response body" - ```json - { - "type": "object", - "properties": { - "items": { - "type": "array", + ??? hint "Schema of the response body" + ```json + { + "type": "object", + "properties": { "items": { - "$ref": "#/components/schemas/ReleaseNodeDownload" + "type": "array", + "items": { + "$ref": "#/components/schemas/ReleaseNodeDownload" + }, + "nullable": true }, - "nullable": true + "total": { + "type": "integer", + "format": "int64" + } }, - "total": { - "type": "integer", - "format": "int64" - } - }, - "additionalProperties": false - } - ``` - - + "additionalProperties": false + } + ``` + + @@ -725,13 +704,10 @@ API health check - -

- Response 200 OK -

- -=== "application/json" +=== "200 OK" + === "application/json" + ```json { @@ -742,30 +718,30 @@ API health check ``` ⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information. - Other possible types: text/json, text/plain + Other possible types: text/json, text/plain - ??? hint "Schema of the response body" - ```json - { - "type": "object", - "properties": { - "alive": { - "type": "boolean" - }, - "timestamp": { - "type": "string", - "format": "date-time" + ??? hint "Schema of the response body" + ```json + { + "type": "object", + "properties": { + "alive": { + "type": "boolean" + }, + "timestamp": { + "type": "string", + "format": "date-time" + }, + "regionName": { + "type": "string", + "nullable": true + } }, - "regionName": { - "type": "string", - "nullable": true - } - }, - "additionalProperties": false - } - ``` - - + "additionalProperties": false + } + ``` + + @@ -801,13 +777,10 @@ API health check - -

- Response 200 OK -

- -=== "application/json" +=== "200 OK" + === "application/json" + ```json { @@ -839,30 +812,30 @@ API health check ``` ⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information. - Other possible types: text/json, text/plain + Other possible types: text/json, text/plain - ??? hint "Schema of the response body" - ```json - { - "type": "object", - "properties": { - "membership": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ProfessionalMembership" + ??? hint "Schema of the response body" + ```json + { + "type": "object", + "properties": { + "membership": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProfessionalMembership" + }, + "nullable": true }, - "nullable": true + "signature": { + "type": "string", + "nullable": true + } }, - "signature": { - "type": "string", - "nullable": true - } - }, - "additionalProperties": false - } - ``` - - + "additionalProperties": false + } + ``` + + @@ -898,13 +871,10 @@ Returns information about the API itself. - -

- Response 200 OK -

- -=== "application/json" +=== "200 OK" + === "application/json" + ```json { @@ -915,31 +885,31 @@ Returns information about the API itself. ``` ⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information. - Other possible types: text/json, text/plain + Other possible types: text/json, text/plain - ??? hint "Schema of the response body" - ```json - { - "type": "object", - "properties": { - "version": { - "type": "string", - "nullable": true - }, - "buildNumber": { - "type": "string", - "nullable": true + ??? hint "Schema of the response body" + ```json + { + "type": "object", + "properties": { + "version": { + "type": "string", + "nullable": true + }, + "buildNumber": { + "type": "string", + "nullable": true + }, + "contactEmail": { + "type": "string", + "nullable": true + } }, - "contactEmail": { - "type": "string", - "nullable": true - } - }, - "additionalProperties": false - } - ``` - - + "additionalProperties": false + } + ``` + + @@ -983,13 +953,10 @@ Returns details about a release by id. - -

- Response 200 OK -

- -=== "application/json" +=== "200 OK" + === "application/json" + ```json { @@ -1082,92 +1049,92 @@ Returns details about a release by id. ``` ⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information. - Other possible types: text/json, text/plain + Other possible types: text/json, text/plain - ??? hint "Schema of the response body" - ```json - { - "required": [ - "creationTime", - "draft", - "eTag", - "name", - "updateTime" - ], - "type": "object", - "properties": { - "eTag": { - "maxLength": 50, - "minLength": 0, - "type": "string" - }, - "creationTime": { - "type": "string", - "format": "date-time" - }, - "updateTime": { - "type": "string", - "format": "date-time" - }, - "id": { - "type": "string", - "format": "uuid" - }, - "name": { - "maxLength": 250, - "type": "string" - }, - "description": { - "type": "string", - "nullable": true - }, - "draft": { - "type": "boolean" - }, - "requestedNotification": { - "type": "boolean" - }, - "categoryId": { - "type": "string", - "nullable": true - }, - "category": { - "$ref": "#/components/schemas/Category" - }, - "nodes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ReleaseNode" + ??? hint "Schema of the response body" + ```json + { + "required": [ + "creationTime", + "draft", + "eTag", + "name", + "updateTime" + ], + "type": "object", + "properties": { + "eTag": { + "maxLength": 50, + "minLength": 0, + "type": "string" }, - "nullable": true - }, - "countries": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ReleaseCountry" + "creationTime": { + "type": "string", + "format": "date-time" }, - "nullable": true - }, - "history": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ReleaseHistory" + "updateTime": { + "type": "string", + "format": "date-time" }, - "nullable": true - }, - "organizations": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ReleaseOrganization" + "id": { + "type": "string", + "format": "uuid" }, - "nullable": true - } - }, - "additionalProperties": false - } - ``` - - + "name": { + "maxLength": 250, + "type": "string" + }, + "description": { + "type": "string", + "nullable": true + }, + "draft": { + "type": "boolean" + }, + "requestedNotification": { + "type": "boolean" + }, + "categoryId": { + "type": "string", + "nullable": true + }, + "category": { + "$ref": "#/components/schemas/Category" + }, + "nodes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReleaseNode" + }, + "nullable": true + }, + "countries": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReleaseCountry" + }, + "nullable": true + }, + "history": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReleaseHistory" + }, + "nullable": true + }, + "organizations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReleaseOrganization" + }, + "nullable": true + } + }, + "additionalProperties": false + } + ``` + +
@@ -1206,10 +1173,7 @@ Deletes a release by id. - -

- Response 200 OK -

+=== "200 OK"
@@ -1312,13 +1276,10 @@ Deletes a release by id. ``` - -

- Response 200 OK -

- -=== "application/json" +=== "200 OK" + === "application/json" + ```json { @@ -1411,92 +1372,92 @@ Deletes a release by id. ``` ⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information. - Other possible types: text/json, text/plain + Other possible types: text/json, text/plain - ??? hint "Schema of the response body" - ```json - { - "required": [ - "creationTime", - "draft", - "eTag", - "name", - "updateTime" - ], - "type": "object", - "properties": { - "eTag": { - "maxLength": 50, - "minLength": 0, - "type": "string" - }, - "creationTime": { - "type": "string", - "format": "date-time" - }, - "updateTime": { - "type": "string", - "format": "date-time" - }, - "id": { - "type": "string", - "format": "uuid" - }, - "name": { - "maxLength": 250, - "type": "string" - }, - "description": { - "type": "string", - "nullable": true - }, - "draft": { - "type": "boolean" - }, - "requestedNotification": { - "type": "boolean" - }, - "categoryId": { - "type": "string", - "nullable": true - }, - "category": { - "$ref": "#/components/schemas/Category" - }, - "nodes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ReleaseNode" + ??? hint "Schema of the response body" + ```json + { + "required": [ + "creationTime", + "draft", + "eTag", + "name", + "updateTime" + ], + "type": "object", + "properties": { + "eTag": { + "maxLength": 50, + "minLength": 0, + "type": "string" }, - "nullable": true - }, - "countries": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ReleaseCountry" + "creationTime": { + "type": "string", + "format": "date-time" }, - "nullable": true - }, - "history": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ReleaseHistory" + "updateTime": { + "type": "string", + "format": "date-time" }, - "nullable": true - }, - "organizations": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ReleaseOrganization" + "id": { + "type": "string", + "format": "uuid" }, - "nullable": true - } - }, - "additionalProperties": false - } - ``` - - + "name": { + "maxLength": 250, + "type": "string" + }, + "description": { + "type": "string", + "nullable": true + }, + "draft": { + "type": "boolean" + }, + "requestedNotification": { + "type": "boolean" + }, + "categoryId": { + "type": "string", + "nullable": true + }, + "category": { + "$ref": "#/components/schemas/Category" + }, + "nodes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReleaseNode" + }, + "nullable": true + }, + "countries": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReleaseCountry" + }, + "nullable": true + }, + "history": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReleaseHistory" + }, + "nullable": true + }, + "organizations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReleaseOrganization" + }, + "nullable": true + } + }, + "additionalProperties": false + } + ``` + +
@@ -1584,13 +1545,10 @@ Deletes a release by id. - -

- Response 200 OK -

- -=== "application/json" +=== "200 OK" + === "application/json" + ```json { @@ -1671,30 +1629,30 @@ Deletes a release by id. ``` ⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information. - Other possible types: text/json, text/plain + Other possible types: text/json, text/plain - ??? hint "Schema of the response body" - ```json - { - "type": "object", - "properties": { - "items": { - "type": "array", + ??? hint "Schema of the response body" + ```json + { + "type": "object", + "properties": { "items": { - "$ref": "#/components/schemas/Release" + "type": "array", + "items": { + "$ref": "#/components/schemas/Release" + }, + "nullable": true }, - "nullable": true + "total": { + "type": "integer", + "format": "int64" + } }, - "total": { - "type": "integer", - "format": "int64" - } - }, - "additionalProperties": false - } - ``` - - + "additionalProperties": false + } + ``` + +
@@ -1779,13 +1737,10 @@ Deletes a release by id. ``` - -

- Response 200 OK -

- -=== "application/json" +=== "200 OK" + === "application/json" + ```json { @@ -1794,23 +1749,23 @@ Deletes a release by id. ``` ⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information. - Other possible types: text/json, text/plain - - ??? hint "Schema of the response body" - ```json - { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid" - } - }, - "additionalProperties": false - } - ``` - + Other possible types: text/json, text/plain + ??? hint "Schema of the response body" + ```json + { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + } + }, + "additionalProperties": false + } + ``` + +
@@ -1842,13 +1797,10 @@ Deletes a release by id. - -

- Response 200 OK -

- -=== "application/json" +=== "200 OK" + === "application/json" + ```json [ @@ -1864,19 +1816,19 @@ Deletes a release by id. ``` ⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information. - Other possible types: text/json, text/plain + Other possible types: text/json, text/plain - ??? hint "Schema of the response body" - ```json - { - "type": "array", - "items": { - "$ref": "#/components/schemas/CurrentRelease" + ??? hint "Schema of the response body" + ```json + { + "type": "array", + "items": { + "$ref": "#/components/schemas/CurrentRelease" + } } - } - ``` - - + ``` + +
@@ -1908,13 +1860,10 @@ Deletes a release by id. - -

- Response 200 OK -

- -=== "application/json" +=== "200 OK" + === "application/json" + ```json [ @@ -1930,19 +1879,19 @@ Deletes a release by id. ``` ⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information. - Other possible types: text/json, text/plain + Other possible types: text/json, text/plain - ??? hint "Schema of the response body" - ```json - { - "type": "array", - "items": { - "$ref": "#/components/schemas/CurrentRelease" + ??? hint "Schema of the response body" + ```json + { + "type": "array", + "items": { + "$ref": "#/components/schemas/CurrentRelease" + } } - } - ``` - - + ``` + +
@@ -1982,13 +1931,10 @@ Deletes a release by id. - -

- Response 200 OK -

- -=== "application/json" +=== "200 OK" + === "application/json" + ```json [ @@ -2064,19 +2010,19 @@ Deletes a release by id. ``` ⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information. - Other possible types: text/json, text/plain + Other possible types: text/json, text/plain - ??? hint "Schema of the response body" - ```json - { - "type": "array", - "items": { - "$ref": "#/components/schemas/ReleaseHistory" + ??? hint "Schema of the response body" + ```json + { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReleaseHistory" + } } - } - ``` - - + ``` + +
@@ -2124,13 +2070,10 @@ Deletes a release by id. - -

- Response 200 OK -

- -=== "application/json" +=== "200 OK" + === "application/json" + ```json { @@ -2139,23 +2082,23 @@ Deletes a release by id. ``` ⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information. - Other possible types: text/json, text/plain - - ??? hint "Schema of the response body" - ```json - { - "type": "object", - "properties": { - "url": { - "type": "string", - "nullable": true - } - }, - "additionalProperties": false - } - ``` - + Other possible types: text/json, text/plain + ??? hint "Schema of the response body" + ```json + { + "type": "object", + "properties": { + "url": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + } + ``` + +
@@ -2203,13 +2146,10 @@ Deletes a release by id. - -

- Response 200 OK -

- -=== "application/json" +=== "200 OK" + === "application/json" + ```json { @@ -2218,23 +2158,23 @@ Deletes a release by id. ``` ⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information. - Other possible types: text/json, text/plain - - ??? hint "Schema of the response body" - ```json - { - "type": "object", - "properties": { - "uniqueDownloads": { - "type": "integer", - "format": "int32" - } - }, - "additionalProperties": false - } - ``` - + Other possible types: text/json, text/plain + ??? hint "Schema of the response body" + ```json + { + "type": "object", + "properties": { + "uniqueDownloads": { + "type": "integer", + "format": "int32" + } + }, + "additionalProperties": false + } + ``` + +
@@ -2307,13 +2247,10 @@ Deletes a release by id. ``` - -

- Response 200 OK -

- -=== "application/json" +=== "200 OK" + === "application/json" + ```json { @@ -2406,92 +2343,92 @@ Deletes a release by id. ``` ⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information. - Other possible types: text/json, text/plain + Other possible types: text/json, text/plain - ??? hint "Schema of the response body" - ```json - { - "required": [ - "creationTime", - "draft", - "eTag", - "name", - "updateTime" - ], - "type": "object", - "properties": { - "eTag": { - "maxLength": 50, - "minLength": 0, - "type": "string" - }, - "creationTime": { - "type": "string", - "format": "date-time" - }, - "updateTime": { - "type": "string", - "format": "date-time" - }, - "id": { - "type": "string", - "format": "uuid" - }, - "name": { - "maxLength": 250, - "type": "string" - }, - "description": { - "type": "string", - "nullable": true - }, - "draft": { - "type": "boolean" - }, - "requestedNotification": { - "type": "boolean" - }, - "categoryId": { - "type": "string", - "nullable": true - }, - "category": { - "$ref": "#/components/schemas/Category" - }, - "nodes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ReleaseNode" + ??? hint "Schema of the response body" + ```json + { + "required": [ + "creationTime", + "draft", + "eTag", + "name", + "updateTime" + ], + "type": "object", + "properties": { + "eTag": { + "maxLength": 50, + "minLength": 0, + "type": "string" }, - "nullable": true - }, - "countries": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ReleaseCountry" + "creationTime": { + "type": "string", + "format": "date-time" }, - "nullable": true - }, - "history": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ReleaseHistory" + "updateTime": { + "type": "string", + "format": "date-time" }, - "nullable": true - }, - "organizations": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ReleaseOrganization" + "id": { + "type": "string", + "format": "uuid" }, - "nullable": true - } - }, - "additionalProperties": false - } - ``` - - + "name": { + "maxLength": 250, + "type": "string" + }, + "description": { + "type": "string", + "nullable": true + }, + "draft": { + "type": "boolean" + }, + "requestedNotification": { + "type": "boolean" + }, + "categoryId": { + "type": "string", + "nullable": true + }, + "category": { + "$ref": "#/components/schemas/Category" + }, + "nodes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReleaseNode" + }, + "nullable": true + }, + "countries": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReleaseCountry" + }, + "nullable": true + }, + "history": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReleaseHistory" + }, + "nullable": true + }, + "organizations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReleaseOrganization" + }, + "nullable": true + } + }, + "additionalProperties": false + } + ``` + +
@@ -2560,13 +2497,10 @@ Deletes a release by id. ``` - -

- Response 200 OK -

- -=== "application/json" +=== "200 OK" + === "application/json" + ```json { @@ -2659,92 +2593,92 @@ Deletes a release by id. ``` ⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information. - Other possible types: text/json, text/plain + Other possible types: text/json, text/plain - ??? hint "Schema of the response body" - ```json - { - "required": [ - "creationTime", - "draft", - "eTag", - "name", - "updateTime" - ], - "type": "object", - "properties": { - "eTag": { - "maxLength": 50, - "minLength": 0, - "type": "string" - }, - "creationTime": { - "type": "string", - "format": "date-time" - }, - "updateTime": { - "type": "string", - "format": "date-time" - }, - "id": { - "type": "string", - "format": "uuid" - }, - "name": { - "maxLength": 250, - "type": "string" - }, - "description": { - "type": "string", - "nullable": true - }, - "draft": { - "type": "boolean" - }, - "requestedNotification": { - "type": "boolean" - }, - "categoryId": { - "type": "string", - "nullable": true - }, - "category": { - "$ref": "#/components/schemas/Category" - }, - "nodes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ReleaseNode" + ??? hint "Schema of the response body" + ```json + { + "required": [ + "creationTime", + "draft", + "eTag", + "name", + "updateTime" + ], + "type": "object", + "properties": { + "eTag": { + "maxLength": 50, + "minLength": 0, + "type": "string" }, - "nullable": true - }, - "countries": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ReleaseCountry" + "creationTime": { + "type": "string", + "format": "date-time" }, - "nullable": true - }, - "history": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ReleaseHistory" + "updateTime": { + "type": "string", + "format": "date-time" }, - "nullable": true - }, - "organizations": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ReleaseOrganization" + "id": { + "type": "string", + "format": "uuid" }, - "nullable": true - } - }, - "additionalProperties": false - } - ``` - - + "name": { + "maxLength": 250, + "type": "string" + }, + "description": { + "type": "string", + "nullable": true + }, + "draft": { + "type": "boolean" + }, + "requestedNotification": { + "type": "boolean" + }, + "categoryId": { + "type": "string", + "nullable": true + }, + "category": { + "$ref": "#/components/schemas/Category" + }, + "nodes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReleaseNode" + }, + "nullable": true + }, + "countries": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReleaseCountry" + }, + "nullable": true + }, + "history": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReleaseHistory" + }, + "nullable": true + }, + "organizations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReleaseOrganization" + }, + "nullable": true + } + }, + "additionalProperties": false + } + ``` + +
@@ -2823,13 +2757,10 @@ Deletes a release by id. ``` - -

- Response 200 OK -

- -=== "application/json" +=== "200 OK" + === "application/json" + ```json { @@ -2922,92 +2853,92 @@ Deletes a release by id. ``` ⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information. - Other possible types: text/json, text/plain + Other possible types: text/json, text/plain - ??? hint "Schema of the response body" - ```json - { - "required": [ - "creationTime", - "draft", - "eTag", - "name", - "updateTime" - ], - "type": "object", - "properties": { - "eTag": { - "maxLength": 50, - "minLength": 0, - "type": "string" - }, - "creationTime": { - "type": "string", - "format": "date-time" - }, - "updateTime": { - "type": "string", - "format": "date-time" - }, - "id": { - "type": "string", - "format": "uuid" - }, - "name": { - "maxLength": 250, - "type": "string" - }, - "description": { - "type": "string", - "nullable": true - }, - "draft": { - "type": "boolean" - }, - "requestedNotification": { - "type": "boolean" - }, - "categoryId": { - "type": "string", - "nullable": true - }, - "category": { - "$ref": "#/components/schemas/Category" - }, - "nodes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ReleaseNode" + ??? hint "Schema of the response body" + ```json + { + "required": [ + "creationTime", + "draft", + "eTag", + "name", + "updateTime" + ], + "type": "object", + "properties": { + "eTag": { + "maxLength": 50, + "minLength": 0, + "type": "string" }, - "nullable": true - }, - "countries": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ReleaseCountry" + "creationTime": { + "type": "string", + "format": "date-time" }, - "nullable": true - }, - "history": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ReleaseHistory" + "updateTime": { + "type": "string", + "format": "date-time" }, - "nullable": true - }, - "organizations": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ReleaseOrganization" + "id": { + "type": "string", + "format": "uuid" }, - "nullable": true - } - }, - "additionalProperties": false - } - ``` - - + "name": { + "maxLength": 250, + "type": "string" + }, + "description": { + "type": "string", + "nullable": true + }, + "draft": { + "type": "boolean" + }, + "requestedNotification": { + "type": "boolean" + }, + "categoryId": { + "type": "string", + "nullable": true + }, + "category": { + "$ref": "#/components/schemas/Category" + }, + "nodes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReleaseNode" + }, + "nullable": true + }, + "countries": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReleaseCountry" + }, + "nullable": true + }, + "history": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReleaseHistory" + }, + "nullable": true + }, + "organizations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReleaseOrganization" + }, + "nullable": true + } + }, + "additionalProperties": false + } + ``` + +
@@ -3075,13 +3006,10 @@ Deletes a release by id. ``` - -

- Response 200 OK -

- -=== "application/json" +=== "200 OK" + === "application/json" + ```json { @@ -3174,92 +3102,92 @@ Deletes a release by id. ``` ⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information. - Other possible types: text/json, text/plain + Other possible types: text/json, text/plain - ??? hint "Schema of the response body" - ```json - { - "required": [ - "creationTime", - "draft", - "eTag", - "name", - "updateTime" - ], - "type": "object", - "properties": { - "eTag": { - "maxLength": 50, - "minLength": 0, - "type": "string" - }, - "creationTime": { - "type": "string", - "format": "date-time" - }, - "updateTime": { - "type": "string", - "format": "date-time" - }, - "id": { - "type": "string", - "format": "uuid" - }, - "name": { - "maxLength": 250, - "type": "string" - }, - "description": { - "type": "string", - "nullable": true - }, - "draft": { - "type": "boolean" - }, - "requestedNotification": { - "type": "boolean" - }, - "categoryId": { - "type": "string", - "nullable": true - }, - "category": { - "$ref": "#/components/schemas/Category" - }, - "nodes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ReleaseNode" + ??? hint "Schema of the response body" + ```json + { + "required": [ + "creationTime", + "draft", + "eTag", + "name", + "updateTime" + ], + "type": "object", + "properties": { + "eTag": { + "maxLength": 50, + "minLength": 0, + "type": "string" }, - "nullable": true - }, - "countries": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ReleaseCountry" + "creationTime": { + "type": "string", + "format": "date-time" }, - "nullable": true - }, - "history": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ReleaseHistory" + "updateTime": { + "type": "string", + "format": "date-time" }, - "nullable": true - }, - "organizations": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ReleaseOrganization" + "id": { + "type": "string", + "format": "uuid" }, - "nullable": true - } - }, - "additionalProperties": false - } - ``` - - + "name": { + "maxLength": 250, + "type": "string" + }, + "description": { + "type": "string", + "nullable": true + }, + "draft": { + "type": "boolean" + }, + "requestedNotification": { + "type": "boolean" + }, + "categoryId": { + "type": "string", + "nullable": true + }, + "category": { + "$ref": "#/components/schemas/Category" + }, + "nodes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReleaseNode" + }, + "nullable": true + }, + "countries": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReleaseCountry" + }, + "nullable": true + }, + "history": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReleaseHistory" + }, + "nullable": true + }, + "organizations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReleaseOrganization" + }, + "nullable": true + } + }, + "additionalProperties": false + } + ``` + +
@@ -3299,13 +3227,10 @@ Deletes a release by id. - -

- Response 200 OK -

- -=== "application/json" +=== "200 OK" + === "application/json" + ```json { @@ -3398,92 +3323,92 @@ Deletes a release by id. ``` ⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information. - Other possible types: text/json, text/plain + Other possible types: text/json, text/plain - ??? hint "Schema of the response body" - ```json - { - "required": [ - "creationTime", - "draft", - "eTag", - "name", - "updateTime" - ], - "type": "object", - "properties": { - "eTag": { - "maxLength": 50, - "minLength": 0, - "type": "string" - }, - "creationTime": { - "type": "string", - "format": "date-time" - }, - "updateTime": { - "type": "string", - "format": "date-time" - }, - "id": { - "type": "string", - "format": "uuid" - }, - "name": { - "maxLength": 250, - "type": "string" - }, - "description": { - "type": "string", - "nullable": true - }, - "draft": { - "type": "boolean" - }, - "requestedNotification": { - "type": "boolean" - }, - "categoryId": { - "type": "string", - "nullable": true - }, - "category": { - "$ref": "#/components/schemas/Category" - }, - "nodes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ReleaseNode" + ??? hint "Schema of the response body" + ```json + { + "required": [ + "creationTime", + "draft", + "eTag", + "name", + "updateTime" + ], + "type": "object", + "properties": { + "eTag": { + "maxLength": 50, + "minLength": 0, + "type": "string" }, - "nullable": true - }, - "countries": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ReleaseCountry" + "creationTime": { + "type": "string", + "format": "date-time" }, - "nullable": true - }, - "history": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ReleaseHistory" + "updateTime": { + "type": "string", + "format": "date-time" }, - "nullable": true - }, - "organizations": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ReleaseOrganization" + "id": { + "type": "string", + "format": "uuid" }, - "nullable": true - } - }, - "additionalProperties": false - } - ``` - - + "name": { + "maxLength": 250, + "type": "string" + }, + "description": { + "type": "string", + "nullable": true + }, + "draft": { + "type": "boolean" + }, + "requestedNotification": { + "type": "boolean" + }, + "categoryId": { + "type": "string", + "nullable": true + }, + "category": { + "$ref": "#/components/schemas/Category" + }, + "nodes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReleaseNode" + }, + "nullable": true + }, + "countries": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReleaseCountry" + }, + "nullable": true + }, + "history": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReleaseHistory" + }, + "nullable": true + }, + "organizations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReleaseOrganization" + }, + "nullable": true + } + }, + "additionalProperties": false + } + ``` + +
@@ -3558,13 +3483,10 @@ Deletes a release by id. ``` - -

- Response 200 OK -

- -=== "application/json" +=== "200 OK" + === "application/json" + ```json { @@ -3657,92 +3579,92 @@ Deletes a release by id. ``` ⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information. - Other possible types: text/json, text/plain + Other possible types: text/json, text/plain - ??? hint "Schema of the response body" - ```json - { - "required": [ - "creationTime", - "draft", - "eTag", - "name", - "updateTime" - ], - "type": "object", - "properties": { - "eTag": { - "maxLength": 50, - "minLength": 0, - "type": "string" - }, - "creationTime": { - "type": "string", - "format": "date-time" - }, - "updateTime": { - "type": "string", - "format": "date-time" - }, - "id": { - "type": "string", - "format": "uuid" - }, - "name": { - "maxLength": 250, - "type": "string" - }, - "description": { - "type": "string", - "nullable": true - }, - "draft": { - "type": "boolean" - }, - "requestedNotification": { - "type": "boolean" - }, - "categoryId": { - "type": "string", - "nullable": true - }, - "category": { - "$ref": "#/components/schemas/Category" - }, - "nodes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ReleaseNode" + ??? hint "Schema of the response body" + ```json + { + "required": [ + "creationTime", + "draft", + "eTag", + "name", + "updateTime" + ], + "type": "object", + "properties": { + "eTag": { + "maxLength": 50, + "minLength": 0, + "type": "string" }, - "nullable": true - }, - "countries": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ReleaseCountry" + "creationTime": { + "type": "string", + "format": "date-time" }, - "nullable": true - }, - "history": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ReleaseHistory" + "updateTime": { + "type": "string", + "format": "date-time" }, - "nullable": true - }, - "organizations": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ReleaseOrganization" + "id": { + "type": "string", + "format": "uuid" }, - "nullable": true - } - }, - "additionalProperties": false - } - ``` - - + "name": { + "maxLength": 250, + "type": "string" + }, + "description": { + "type": "string", + "nullable": true + }, + "draft": { + "type": "boolean" + }, + "requestedNotification": { + "type": "boolean" + }, + "categoryId": { + "type": "string", + "nullable": true + }, + "category": { + "$ref": "#/components/schemas/Category" + }, + "nodes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReleaseNode" + }, + "nullable": true + }, + "countries": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReleaseCountry" + }, + "nullable": true + }, + "history": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReleaseHistory" + }, + "nullable": true + }, + "organizations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReleaseOrganization" + }, + "nullable": true + } + }, + "additionalProperties": false + } + ``` + + diff --git a/tests/res/example2-output.md b/tests/res/example2-output.md index 5bb5c0b..c1f1d8f 100644 --- a/tests/res/example2-output.md +++ b/tests/res/example2-output.md @@ -79,13 +79,10 @@ List all pets - -

- Response 200 OK -

- -=== "application/json" +=== "200 OK" + === "application/json" + ```json [ @@ -99,47 +96,44 @@ List all pets ``` ⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information. - + - ??? hint "Schema of the response body" - ```json - { - "type": "array", - "items": { - "$ref": "#/components/schemas/Pet" + ??? hint "Schema of the response body" + ```json + { + "type": "array", + "items": { + "$ref": "#/components/schemas/Pet" + } } - } - ``` - - -
-

Response headers

- - - - - - - - - - - - - - - - -
NameDescriptionSchema
x-nextA link to the next page of responsesstring
-
- - -

- Other responses -

- -=== "application/json" + ``` + +
+

Response headers

+ + + + + + + + + + + + + + + + +
NameDescriptionSchema
x-nextA link to the next page of responsesstring
+
+ +=== "Other responses" + + === "application/json" + ```json { @@ -149,29 +143,29 @@ List all pets ``` ⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information. - + - ??? hint "Schema of the response body" - ```json - { - "type": "object", - "required": [ - "code", - "message" - ], - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" + ??? hint "Schema of the response body" + ```json + { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } } } - } - ``` - - + ``` + +
@@ -210,17 +204,11 @@ Create a pet - -

- Response 201 Created -

- -

- Other responses -

- -=== "application/json" +=== "201 Created" +=== "Other responses" + === "application/json" + ```json { @@ -230,29 +218,29 @@ Create a pet ``` ⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information. - + - ??? hint "Schema of the response body" - ```json - { - "type": "object", - "required": [ - "code", - "message" - ], - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" + ??? hint "Schema of the response body" + ```json + { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } } } - } - ``` - - + ``` + +
@@ -300,13 +288,10 @@ Info for a specific pet - -

- Response 200 OK -

- -=== "application/json" +=== "200 OK" + === "application/json" + ```json { @@ -318,48 +303,45 @@ Info for a specific pet ``` ⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information. - + - ??? hint "Schema of the response body" - ```json - { - "type": "object", - "required": [ - "id", - "name" - ], - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "name": { - "type": "string" - }, - "tag": { - "type": "string" - }, - "category": { - "type": "string", - "enum": [ - "One", - "Two", - "Three" - ] + ??? hint "Schema of the response body" + ```json + { + "type": "object", + "required": [ + "id", + "name" + ], + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + }, + "category": { + "type": "string", + "enum": [ + "One", + "Two", + "Three" + ] + } } } - } - ``` - - - -

- Other responses -

- -=== "application/json" + ``` +=== "Other responses" + + === "application/json" + + ```json { "code": 26, @@ -368,29 +350,29 @@ Info for a specific pet ``` ⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information. - + - ??? hint "Schema of the response body" - ```json - { - "type": "object", - "required": [ - "code", - "message" - ], - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" + ??? hint "Schema of the response body" + ```json + { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } } } - } - ``` - - + ``` + +
@@ -452,10 +434,7 @@ Info for a specific pet ``` - -

- Response 200 OK -

+=== "200 OK" diff --git a/tests/res/example3-output.md b/tests/res/example3-output.md index 7c32185..f541d8e 100644 --- a/tests/res/example3-output.md +++ b/tests/res/example3-output.md @@ -63,13 +63,10 @@ List all pets - -

- Response 200 OK -

- -=== "application/json" +=== "200 OK" + === "application/json" + ```json [ @@ -83,47 +80,44 @@ List all pets ``` ⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information. - + - ??? hint "Schema of the response body" - ```json - { - "type": "array", - "items": { - "$ref": "#/components/schemas/Pet" + ??? hint "Schema of the response body" + ```json + { + "type": "array", + "items": { + "$ref": "#/components/schemas/Pet" + } } - } - ``` - - -
-

Response headers

- - - - - - - - - - - - - - - - -
NameDescriptionSchema
x-nextA link to the next page of responsesstring
-
- - -

- Other responses -

- -=== "application/json" + ``` + + +
+

Response headers

+ + + + + + + + + + + + + + + + +
NameDescriptionSchema
x-nextA link to the next page of responsesstring
+
+ +=== "Other responses" + === "application/json" + ```json { @@ -133,45 +127,39 @@ List all pets ``` ⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information. - - - ??? hint "Schema of the response body" - ```json - { - "type": "object", - "required": [ - "code", - "message" - ], - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" + + + ??? hint "Schema of the response body" + ```json + { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } } } - } - ``` - - + ``` + +
### POST /pets Create a pet - -

- Response 201 Created -

- -

- Other responses -

- -=== "application/json" +=== "201 Created" +=== "Other responses" + === "application/json" + ```json { @@ -181,29 +169,29 @@ Create a pet ``` ⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information. - - - ??? hint "Schema of the response body" - ```json - { - "type": "object", - "required": [ - "code", - "message" - ], - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" + + + ??? hint "Schema of the response body" + ```json + { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } } } - } - ``` - - + ``` + +
@@ -235,13 +223,10 @@ Info for a specific pet - -

- Response 200 OK -

- -=== "application/json" +=== "200 OK" + === "application/json" + ```json { @@ -253,48 +238,45 @@ Info for a specific pet ``` ⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information. - - - ??? hint "Schema of the response body" - ```json - { - "type": "object", - "required": [ - "id", - "name" - ], - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "name": { - "type": "string" - }, - "tag": { - "type": "string" - }, - "category": { - "type": "string", - "enum": [ - "One", - "Two", - "Three" - ] + + + ??? hint "Schema of the response body" + ```json + { + "type": "object", + "required": [ + "id", + "name" + ], + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "tag": { + "type": "string" + }, + "category": { + "type": "string", + "enum": [ + "One", + "Two", + "Three" + ] + } } } - } - ``` - - - -

- Other responses -

- -=== "application/json" + ``` +=== "Other responses" + + === "application/json" + + ```json { "code": 26, @@ -303,29 +285,29 @@ Info for a specific pet ``` ⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information. - - - ??? hint "Schema of the response body" - ```json - { - "type": "object", - "required": [ - "code", - "message" - ], - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" + + + ??? hint "Schema of the response body" + ```json + { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + } } } - } - ``` - - + ``` + +
@@ -354,10 +336,7 @@ Info for a specific pet ``` - -

- Response 200 OK -

+=== "200 OK" diff --git a/tests/res/example4-split-output.md b/tests/res/example4-split-output.md index 77c4e22..22a639f 100644 --- a/tests/res/example4-split-output.md +++ b/tests/res/example4-split-output.md @@ -110,13 +110,10 @@ Invite a user ``` - -

- Response 200 OK -

- -=== "application/json" +=== "200 OK" + === "application/json" + ```json [ @@ -140,24 +137,21 @@ Invite a user ``` ⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information. - + - ??? hint "Schema of the response body" - ```json - { - "type": "array", - "items": { - "$ref": "#/components/schemas/UserInformation" + ??? hint "Schema of the response body" + ```json + { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserInformation" + } } - } - ``` - - - -

- Response 401 Unauthorized -

-

Refer to the common response description: Unauthorized.

+ ``` + + +=== "401 Unauthorized" +

Refer to the common response description: Unauthorized.


@@ -209,13 +203,10 @@ Retrieve all users - -

- Response 200 OK -

- -=== "application/json" +=== "200 OK" + === "application/json" + ```json { @@ -242,35 +233,32 @@ Retrieve all users ``` ⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information. - + - ??? hint "Schema of the response body" - ```json - { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/UserInformation" + ??? hint "Schema of the response body" + ```json + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserInformation" + } + }, + "nextCursor": { + "type": "string", + "description": "Paginate through users by setting the cursor parameter to a nextCursor attribute returned by a previous request. Default value fetches the first \"page\" of the collection.", + "nullable": true, + "example": "MTIzZTQ1NjctZTg5Yi0xMmQzLWE0NTYtNDI2NjE0MTc0MDA" } - }, - "nextCursor": { - "type": "string", - "description": "Paginate through users by setting the cursor parameter to a nextCursor attribute returned by a previous request. Default value fetches the first \"page\" of the collection.", - "nullable": true, - "example": "MTIzZTQ1NjctZTg5Yi0xMmQzLWE0NTYtNDI2NjE0MTc0MDA" } } - } - ``` - - - -

- Response 401 Unauthorized -

-

Refer to the common response description: Unauthorized.

+ ``` + + +=== "401 Unauthorized" +

Refer to the common response description: Unauthorized.


@@ -314,16 +302,10 @@ Get user by ID/Email - -

- Response 200 OK -

-

Refer to the common response description: UserInformation.

- -

- Response 401 Unauthorized -

-

Refer to the common response description: Unauthorized.

+=== "200 OK" +

Refer to the common response description: UserInformation.

+=== "401 Unauthorized" +

Refer to the common response description: Unauthorized.


@@ -374,16 +356,10 @@ Delete user by ID/Email - -

- Response 200 OK -

-

Refer to the common response description: UserInformation.

- -

- Response 401 Unauthorized -

-

Refer to the common response description: Unauthorized.

+=== "200 OK" +

Refer to the common response description: UserInformation.

+=== "401 Unauthorized" +

Refer to the common response description: Unauthorized.

From c7cd4bf67467a632d4d6d75008b89e0eabbb7b82 Mon Sep 17 00:00:00 2001 From: Roberto Prevato Date: Fri, 6 Mar 2026 20:37:25 +0100 Subject: [PATCH 2/3] Minor version bump --- CHANGELOG.md | 2 +- openapidocs/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f36732f..ccee740 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [1.3.1] - 2026-03-?? +## [1.4.0] - 2026-03-?? - Add OAS 3.1 support, cross-version warnings, and fix nullable spacing, by @dcode. - Fix MARKDOWN style table separators to use minimum 3 hyphens (issue #39), reported by @michael-nok. diff --git a/openapidocs/__init__.py b/openapidocs/__init__.py index ce3e94f..39b806b 100644 --- a/openapidocs/__init__.py +++ b/openapidocs/__init__.py @@ -1,2 +1,2 @@ -__version__ = "1.3.1" +__version__ = "1.4.0" VERSION = __version__ From 03b62f6485c8b2af6cb4f3fc2acad93e7f0abb1d Mon Sep 17 00:00:00 2001 From: Roberto Prevato Date: Fri, 6 Mar 2026 20:38:10 +0100 Subject: [PATCH 3/3] Add CHANGELOG entry for issue #35 under 1.4.0 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ccee740..7d6e3c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fix [#30](https://github.com/Neoteroi/essentials-openapi/issues/30): raise an error when trying to generate output from an older Swagger v2 specification file (these were never supported as there was never a `/mk/v2/` namespace, intentionally). +- Fix [#35](https://github.com/Neoteroi/essentials-openapi/issues/35): group response + codes in a tab group on MkDocs output, reported by @Andre601. ## [1.3.0] - 2025-11-19