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 WNM validation #2

Merged
merged 2 commits into from
Jun 19, 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
6 changes: 3 additions & 3 deletions cookbook/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ toc::[]

include::sections/introduction.adoc[]

include::sections/data-consumers/index.adoc[]
include::sections/data-consumers.adoc[]

include::sections/data-publishers/index.adoc[]
include::sections/data-publishers.adoc[]

include::sections/global-service-operators/*.adoc[]
include::sections/global-service-operators.adoc[]
36 changes: 36 additions & 0 deletions cookbook/sections/data-publishers.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
== Recipes for data publishers

=== Validate a WIS2 Notification Message

A https://wmo-im.github.io/wis2-notification-message[WIS2 Notification Message] provides a http://schemas.wmo.int/wnm[JSON Schema] which can be used by any progreamming language that supports JSON and JSON Schema validation.

.Using Python and check-jsonschema
[source,bash]
----
# install check-jsonschema Python Package from the Python Package Index (PyPI)
pip3 install check-jsonschema

# download WNM schema
curl -O http://schemas.wmo.int/wnm/1.0.0/schemas/wis2-notification-message-bundled.json

# run schema validation
check-jsonschema --schemafile wis2-notification-message-bundled.json /path/to/my/wnm.json
----

The https://github.com/wmo-im/pywis-pubsub[pywis-pubsub] tool provides a test suite to validate a message against the WNM specification requirements, as well as a Python API for application integration. Consult the pywis-pubsub README on GitHub for more information/examples.

.Using pywis-pubsub
[source,bash]
----
# install pywis-pubsub
pip3 install pywis-pubsub

# sync WIS2 notification schema
pywis-pubsub schema sync

# validate WNM against abstract test suite (file on disk)
pywis-pubsub ets validate /path/to/file.json

# validate WNM against abstract test suite (URL)
pywis-pubsub ets validate https://example.org/path/to/file.json
----
7 changes: 0 additions & 7 deletions cookbook/sections/data-publishers/generate-wcmp2.adoc

This file was deleted.

2 changes: 0 additions & 2 deletions cookbook/sections/data-publishers/index.adoc

This file was deleted.

2 changes: 2 additions & 0 deletions cookbook/sections/introduction.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
=== Purpose

In conjunction with the Manual on the WMO Information System volume II (WMO-No. 1060) (Manual on WIS volume II: WIS 2.0), the present Guide to the WMO Information System volume II (Guide to WIS volume II: WIS 2.0) is designed to ensure adequate uniformity and standardization in the data, information and communication practices, procedures and specifications employed by Members of the World Meteorological Organization (WMO) in the operation of the WMO Information System WIS 2.0 as it supports the mission of the Organization. The Manual on WIS contains standard and recommended practices, procedures and specifications. The Guide to WIS contains additional information concerning practices, procedures, and specifications that Members are invited to follow or implement in establishing and conducting their arrangements in compliance with the WMO Technical Regulations and in developing meteorological and hydrological services.

This cookbook provides various code snippets, recipes and workflow examples in support of WIS2 requirements. This cookbook is a working document; contributions are encouraged and can be added via https://github.com/wmo-im/wis2-cookbook[GitHub].
Loading