Skip to content

Commit 39c07b8

Browse files
committed
add recipe for WCMP2 validation
1 parent 27d545d commit 39c07b8

File tree

5 files changed

+45
-2
lines changed

5 files changed

+45
-2
lines changed

.github/workflows/cookbook.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@ jobs:
2222
uses: actions/checkout@v3
2323
- name: build documentation
2424
run: |
25-
cd cookbook \
25+
mkdir -p /tmp/wis2-cookbook/cookbook/images \
26+
&& cd cookbook \
2627
&& asciidoctor --trace -o /tmp/wis2-cookbook/cookbook/${FILE_BASENAME}.html index.adoc \
2728
&& asciidoctor -a allow-uri-read --trace --backend docbook --out-file - index.adoc | pandoc --from docbook --to docx --output /tmp/wis2-cookbook/cookbook/${FILE_BASENAME}.docx \
2829
&& asciidoctor -a allow-uri-read --trace -r asciidoctor-pdf --trace -b pdf -o /tmp/wis2-cookbook/cookbook/${FILE_BASENAME}.pdf index.adoc \
30+
&& cp images/*.png /tmp/wis2-cookbook/cookbook/images \
2931
&& cd ..
3032
- name: checkout gh-pages branch
3133
uses: actions/checkout@v3

.github/workflows/test-cookbook.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ jobs:
2222
uses: actions/checkout@v3
2323
- name: build documentation
2424
run: |
25-
cd cookbook \
25+
mkdir -p /tmp/wis2-cookbook/cookbook/images \
26+
&& cd cookbook \
2627
&& asciidoctor --trace -o /tmp/wis2-cookbook/cookbook/${FILE_BASENAME}.html index.adoc \
2728
&& asciidoctor -a allow-uri-read --trace --backend docbook --out-file - index.adoc | pandoc --from docbook --to docx --output /tmp/wis2-cookbook/cookbook/${FILE_BASENAME}.docx \
2829
&& asciidoctor -a allow-uri-read --trace -r asciidoctor-pdf --trace -b pdf -o /tmp/wis2-cookbook/cookbook/${FILE_BASENAME}.pdf index.adoc
111 KB
Loading
215 KB
Loading

cookbook/sections/data-publishers.adoc

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,43 @@ Note:
8080
* only properties defined in the OpenAPI Security Scheme defintion are allowed. Any additional properties will invalidate the WNM
8181

8282
Of course, always ensure your WNM is valid (see <<Validate a WIS2 Notification Message>> for more information).
83+
84+
=== Validate a WMO Core Metadata Profile record
85+
86+
The [pywcmp](https://github.com/wmo-im/pywcmp) tool provides a test suite to validate a message against the WCMP2 specification requirements, as well as a Python API for application integration. Consult the pywcmp README on GitHub for more information/examples.
87+
88+
.Using pywcmp
89+
[source,bash]
90+
----
91+
# install pywcmp
92+
pip3 install pywcmp
93+
94+
# sync WCMP2 schemas and codelists
95+
pywis-pubsub bundle sync
96+
97+
# validate WCMP2 against abstract test suite (file on disk)
98+
pywcmp ets validate /path/to/file.json
99+
100+
# validate WCMP2 against abstract test suite (URL)
101+
pywcmp ets validate https://example.org/path/to/file.json
102+
----
103+
104+
A WCMP2 record can also be validated using pywcmp "as a service" using the Canadian WIS2 Global Discovery Catalogue, which provides an online validator:
105+
106+
- Navigate to https://wis2-gdc.weather.gc.ca/openapi?f=html
107+
- Navigate to section *pywcmp-wis2-wcmp2-ets*, endpoint `/processes/pywcmp-wis2-wcmp2-ets/execution` (POST)
108+
- Click "Try it out"
109+
- In the section "Mandatory execute request JSON", paste the WCMP2 JSON inside the `record` object
110+
111+
.WIS2 GDC online validator, request
112+
image::images/data-publishers-wcmp2-validate-request.png[WIS2 GDC online validator, request]
113+
114+
- Click "Execute"
115+
116+
.WIS2 GDC online validator, response
117+
image::images/data-publishers-wcmp2-validate-response.png[WIS2 GDC online validator, response]
118+
119+
A response will be provided with validation results.
120+
121+
122+

0 commit comments

Comments
 (0)