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

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

Open TakahikoKawasaki opened this issue 1 year ago • 5 comments

This script updates the schema IDs in the following YAML files:

  • schemas/v{major}.{minor}/schema.yaml
  • schemas/v{major}.{minor}/schema-base.yaml

and generates the following JSON files from the updated YAML files:

  • schemas/v{major}.{minor}/schema.json
  • schemas/v{major}.{minor}/schema-base.json

TakahikoKawasaki avatar May 17 '24 05: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 09 '24 22:06 TakahikoKawasaki

@ralfhandl script so far looks good to me, but I'll let you run with it.

miqui avatar Jun 09 '24 23:06 miqui

I see you're using ex (which is a neutered form of vim) to do the substitutions -- I'm wondering why you made this choice, vs. the more usual choice of sed which provides access to a richer set of regular expressions?

karenetheridge avatar Jun 20 '24 16:06 karenetheridge

@karenetheridge Sorry, I did not know the -i option of sed. The ex command line can be replaced with sed if it is desired.

TakahikoKawasaki avatar Jul 01 '24 05:07 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 16:10 lornajane