|
80 | 80 | * only properties defined in the OpenAPI Security Scheme defintion are allowed. Any additional properties will invalidate the WNM
|
81 | 81 |
|
82 | 82 | 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