Skip to content

gh-pages: view link and download link for latest JSON schemas #4034

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ This site contains the OpenAPI Initiative Registry and content for the HTML vers

## Development

> [!NOTE]
> As of 2024-08-28 Jekyll version 4.3.2 does _not_ work with Ruby 3.3.x.
>
> Make sure you have Ruby 3.2.x or lower installed.

Install [jekyll](https://jekyllrb.com/docs/installation/) for your platform, install the site
~~~sh
bundle install
Expand Down
11 changes: 8 additions & 3 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,20 @@ This site contains the OpenAPI Initiative Registry and content for the HTML vers

{% assign schema_files = site.static_files | where: "extname", "" | sort: "path" | reverse %}
{% assign last_version = "" %}
{% assign last_kind = "" %}
{%- for file in schema_files -%}
{%- assign segments = file.path | split: "/" -%}
{%- if segments[1] == "oas" and file.basename contains "lat" -%}
{%- if segments[1] == "oas" and file.basename contains "-" -%}
{%- if segments[2] != last_version -%}
{%- assign last_version = segments[2] %}
* **v{{ last_version }}**
{%- endif -%}
{%- if segments[3] != last_kind -%}
{%- assign last_kind = segments[3] %}
* [**{{ last_kind }}**]({{ site.baseurl }}/oas/{{ last_version }}/{{ last_kind }}/latest.html)
{%- assign separator = ": " -%}
{%- endif -%}
{{ separator }}[{{ segments[3] }}]({{ file.path }})
{{ separator }} [{{ file.basename }}]({{ site.baseurl }}{{ file.path }})
{%- assign separator = ", " -%}
{%- endif -%}
{%- endfor -%}
{%- endfor %}
9 changes: 9 additions & 0 deletions oas/3.0/schema/latest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: JSON Schema for OpenAPI 3.0
layout: default
parent: Schemas
---

```json
{% include_relative latest %}
```
9 changes: 9 additions & 0 deletions oas/3.1/schema-base/latest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: JSON Schema for OpenAPI 3.1 - with schema validation
layout: default
parent: Schemas
---

```json
{% include_relative latest %}
```
9 changes: 9 additions & 0 deletions oas/3.1/schema/latest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: JSON Schema for OpenAPI 3.1 - without schema validation
layout: default
parent: Schemas
---

```json
{% include_relative latest %}
```