Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ 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.
- Fix [#45](https://github.com/Neoteroi/essentials-openapi/issues/45): add support for displaying descriptions of schema properties, reported by @Maia-Everett.
- 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

Expand Down
2 changes: 1 addition & 1 deletion openapidocs/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = "1.3.1"
__version__ = "1.4.0"
VERSION = __version__
103 changes: 45 additions & 58 deletions openapidocs/mk/v3/views_mkdocs/partial/request-responses.html
Original file line number Diff line number Diff line change
@@ -1,63 +1,50 @@
{% for code, definition in operation.responses.items() %}

<p class="response-title">
{% if code == "default" -%}
<strong>{{texts.other_responses}}</strong>
{%- else -%}
<strong>Response <span class="response-code code-{{code}}">{{code}}</span>
{%- with phrase = get_http_status_phrase(code) -%}
{%- if phrase -%}
&nbsp;<span class="status-phrase">{{ phrase }}</span>
{%- 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/", "") %}
<div class="common-response"><p>Refer to the common response description: <a href="#{{type_name.lower() | link}}" class="ref-link">{{type_name}}</a>.</p></div>
{%- endwith -%}
</strong>
{%- endif %}
</p>
{%- if is_reference(definition) -%}
{%- with type_name = definition["$ref"].replace("#/components/responses/", "") %}
<div class="common-response"><p>Refer to the common response description: <a href="#{{type_name.lower() | link}}" class="ref-link">{{type_name}}</a>.</p></div>
{%- 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 %}<em class="small-note alt-types">{{texts.other_possible_types}}: {{definition.alt_types | join(", ")}}</em>{% 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 %}<em class="small-note alt-types">{{texts.other_possible_types}}: {{definition.alt_types | join(", ")}}</em>{% endif %}

??? hint "{{texts.schema_of_the_response_body}}"
```json
{{handler.write_content_schema(definition) | indent(8) | safe}}
```
{% endfor %}
{% endwith -%}
{% endif -%}
{%- if definition.headers %}
<div class="response-section">
<p class="response-headers sub-section-title">{{texts.response_headers}}</p>
??? hint "{{texts.schema_of_the_response_body}}"
```json
{{handler.write_content_schema(definition) | indent(12) | safe}}
```
{% endfor %}
{% endwith -%}
{% endif -%}
{%- if definition.headers %}
<div class="response-section">
<p class="response-headers sub-section-title">{{texts.response_headers}}</p>

<table>
<thead>
<tr>
<th>{{texts.name}}</th>
<th>{{texts.description}}</th>
<th>{{texts.schema}}</th>
</tr>
</thead>
<tbody>
{%- for header_name, header_definition in definition.headers.items() %}
<tr>
<td><code>{{header_name}}</code></td>
<td>{{header_definition.description}}</td>
<td>
{%- with schema = header_definition.schema %}
{%- include "partial/schema-repr.html" -%}
{% endwith -%}
</td>
</tr>
{%- endfor %}
</tbody>
</table>
</div>
{% endif -%}
<table>
<thead>
<tr>
<th>{{texts.name}}</th>
<th>{{texts.description}}</th>
<th>{{texts.schema}}</th>
</tr>
</thead>
<tbody>
{%- for header_name, header_definition in definition.headers.items() %}
<tr>
<td><code>{{header_name}}</code></td>
<td>{{header_definition.description}}</td>
<td>
{%- with schema = header_definition.schema %}
{%- include "partial/schema-repr.html" -%}
{% endwith -%}
</td>
</tr>
{%- endfor %}
</tbody>
</table>
</div>
{% endif -%}
{%- endfor -%}
Loading