OpenAPI-Specification icon indicating copy to clipboard operation
OpenAPI-Specification copied to clipboard

[new] scripts/update-schema-latest.sh

Open TakahikoKawasaki opened this issue 1 year ago • 2 comments

This script does the following.

  1. Switch to the 'gh-pages' branch.

  2. Copy "schemas/v{major}.{minor}/schema.json" in the 'main' branch to "oas/{major}.{minor}/schema/{YYYY-MM-DD}" in the 'gh-pages' branch. The value of {YYYY-MM-DD} is extracted from the '$id' property in the schema.json file.

  3. Create a symbolic link "latest" under "oas/{major}.{minor}/schema" that points to the "{YYYY-MM-DD}" file.

  4. Copy "schemas/v{major}.{minor}/schema-base.json" in the 'main' branch to "oas/{major}.{minor}/schema-base/{YYYY-MM-DD}" in the 'gh-pages' branch. The value of {YYYY-MM-DD} is extracted from the '$id' property in the schema-base.json file.

  5. Create a symbolic link "latest" under "oas/{major}.{minor}/schema-base" that points to the "{YYYY-MM-DD}" file.

TakahikoKawasaki avatar May 17 '24 06:05 TakahikoKawasaki

Hi @TakahikoKawasaki,

Thanks for providing the script.

The script works fine for the v3.1 case with separate schema and schema-base, and fail for the v3.0 case where there is only schema.

Would you mind adding this distinction to the scripts?

Thanks in advance!

ralfhandl avatar May 24 '24 07:05 ralfhandl

@ralfhandl

  • Updated the script to support the version 3.0.
  • Versions older than 3.0 are rejected on the assumption that maintenance of 2.x and older versions has stopped.

If it is necessary to support versions older than 3.0, please let me know.

TakahikoKawasaki avatar Jun 10 '24 00:06 TakahikoKawasaki

I'm closing this pull request since it's no longer needed since the recent changes to the schema publishing process.

lornajane avatar Oct 31 '24 17:10 lornajane