Skip to content
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

add recipe for WCMP2 validation #5

Merged
merged 1 commit into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/cookbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ jobs:
uses: actions/checkout@v3
- name: build documentation
run: |
cd cookbook \
mkdir -p /tmp/wis2-cookbook/cookbook/images \
&& cd cookbook \
&& asciidoctor --trace -o /tmp/wis2-cookbook/cookbook/${FILE_BASENAME}.html index.adoc \
&& 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 \
&& asciidoctor -a allow-uri-read --trace -r asciidoctor-pdf --trace -b pdf -o /tmp/wis2-cookbook/cookbook/${FILE_BASENAME}.pdf index.adoc \
&& cp images/*.png /tmp/wis2-cookbook/cookbook/images \
&& cd ..
- name: checkout gh-pages branch
uses: actions/checkout@v3
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/test-cookbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ jobs:
uses: actions/checkout@v3
- name: build documentation
run: |
cd cookbook \
mkdir -p /tmp/wis2-cookbook/cookbook/images \
&& cd cookbook \
&& asciidoctor --trace -o /tmp/wis2-cookbook/cookbook/${FILE_BASENAME}.html index.adoc \
&& 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 \
&& asciidoctor -a allow-uri-read --trace -r asciidoctor-pdf --trace -b pdf -o /tmp/wis2-cookbook/cookbook/${FILE_BASENAME}.pdf index.adoc
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions cookbook/sections/data-publishers.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,43 @@ Note:
* only properties defined in the OpenAPI Security Scheme defintion are allowed. Any additional properties will invalidate the WNM

Of course, always ensure your WNM is valid (see <<Validate a WIS2 Notification Message>> for more information).

=== Validate a WMO Core Metadata Profile record

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.

.Using pywcmp
[source,bash]
----
# install pywcmp
pip3 install pywcmp

# sync WCMP2 schemas and codelists
pywis-pubsub bundle sync

# validate WCMP2 against abstract test suite (file on disk)
pywcmp ets validate /path/to/file.json

# validate WCMP2 against abstract test suite (URL)
pywcmp ets validate https://example.org/path/to/file.json
----

A WCMP2 record can also be validated using pywcmp "as a service" using the Canadian WIS2 Global Discovery Catalogue, which provides an online validator:

- Navigate to https://wis2-gdc.weather.gc.ca/openapi?f=html
- Navigate to section *pywcmp-wis2-wcmp2-ets*, endpoint `/processes/pywcmp-wis2-wcmp2-ets/execution` (POST)
- Click "Try it out"
- In the section "Mandatory execute request JSON", paste the WCMP2 JSON inside the `record` object

.WIS2 GDC online validator, request
image::images/data-publishers-wcmp2-validate-request.png[WIS2 GDC online validator, request]

- Click "Execute"

.WIS2 GDC online validator, response
image::images/data-publishers-wcmp2-validate-response.png[WIS2 GDC online validator, response]

A response will be provided with validation results.



Loading