diff --git a/.github/workflows/cookbook.yml b/.github/workflows/cookbook.yml index 0c64399..ac1ed8e 100644 --- a/.github/workflows/cookbook.yml +++ b/.github/workflows/cookbook.yml @@ -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 diff --git a/.github/workflows/test-cookbook.yml b/.github/workflows/test-cookbook.yml index db760ce..301063b 100644 --- a/.github/workflows/test-cookbook.yml +++ b/.github/workflows/test-cookbook.yml @@ -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 diff --git a/cookbook/images/data-publishers-wcmp2-validate-request.png b/cookbook/images/data-publishers-wcmp2-validate-request.png new file mode 100644 index 0000000..1c41a97 Binary files /dev/null and b/cookbook/images/data-publishers-wcmp2-validate-request.png differ diff --git a/cookbook/images/data-publishers-wcmp2-validate-response.png b/cookbook/images/data-publishers-wcmp2-validate-response.png new file mode 100644 index 0000000..42a7c32 Binary files /dev/null and b/cookbook/images/data-publishers-wcmp2-validate-response.png differ diff --git a/cookbook/sections/data-publishers.adoc b/cookbook/sections/data-publishers.adoc index 179a189..818e0a6 100644 --- a/cookbook/sections/data-publishers.adoc +++ b/cookbook/sections/data-publishers.adoc @@ -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 <> 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. + + +