Skip to content

Commit bef3d00

Browse files
Added readme to schema-templating
1 parent 206ff0d commit bef3d00

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

schema-templating/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#Schema Templating
2+
3+
A collection of files and scripts used to modifying Openapi specification files in yaml format.
4+
5+
##How to run
6+
7+
Run build-schema.sh in this directory with 1 argument: a file path to a yaml schema "template" file.
8+
The directory example-yaml-templates has a number of yaml files that have tags of the pattern "X-replace-..."
9+
When build-schema.sh is run with the path to the desired file, general_schema_template_transformer.py will be executed
10+
The X-replace tags have under them url's or direct file paths to the location of yaml files where desired information is located.
11+
If that yaml file also has X-replace tags, this process will repeat until all replacements are made. The final result
12+
is output as a new yaml file called my-spec.yaml. If build-schema.sh does not receive precisely 1 argument, an error is thrown.
13+
If the file given as an argument does not exist, an error is also thrown.
14+
15+
####Usage:
16+
````angular2html
17+
./build-schema.sh example-yaml-templates/search-api-spec-TEMPLATE.yaml
18+
````
19+
20+
##A note on schema_template_transformer.py
21+
22+
This python script is deprecated. It had similar functionality to general_schema_template_transformer.py however it only could
23+
replace portions of a single file by retrieving enumerated lists from an external yaml file by url. It is kept in this directory
24+
only for context and record keeping purposes.
25+
26+

0 commit comments

Comments
 (0)