-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
Generate 3.0 JSON examples from 3.0 YAML examples in json/yaml subfolders #1385
Comments
Refs #1357 |
Yes, I should have mentioned that the PR referenced inspired this decision. We don't want to add maintenance burden by having both formats, but we can generate them. |
What kind of tooling would you accept into the repo? Is there any preference for language/toolchain to use? With PHP installed, the following YAMLS := $(wildcard ./*.yaml)
JSONS := $(patsubst ./%.yaml, ./%.json, $(YAMLS))
all: vendor/bin/php-openapi $(JSONS)
vendor/bin/php-openapi:
echo '{}' > composer.json
composer require cebe/php-openapi 'symfony/yaml:~4.2.0'
%.json: %.yaml
vendor/bin/php-openapi convert --read-yaml $< --write-json $@
.PHONY: all
If PHP and GNU Make is acceptable tooling, I can send a PR with setting it up. |
I'd put in a request for this too. It's not like it's hard to convert on ones own, but I was just looking for some quick test data. Even just one json example would have been enough to save me the trouble of converting it myself. |
This workflow updates the *.json files in the examples/v3.0 directory, when the corresponding *.yaml files change. JSON example files are automatically generated from the YAML example files. Only the YAML files should be adjusted manually. fixes OAI#1385 - When a push to `master` (or any other branch we wish to include) is made, a Github Actions Workflow is triggered ([example](https://github.com/cebe/OpenAPI-Specification/commit/9c98e819ae876af92c2a9112dcfa6dfcb929e7dc/checks?check_suite_id=331067708)) - it will generate new JSON files from the YAML examples - if there are any changes, it will create a pull request to the branch that triggered the Workflow ([example](#3))
Closing as #2199 was merged. Thanks all. |
No description provided.
The text was updated successfully, but these errors were encountered: