Skip to content

Commit

Permalink
update WNM schema (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkralidis authored Jun 1, 2023
1 parent 0c90b31 commit b5e5002
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pywis_pubsub/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@

LOGGER = logging.getLogger(__name__)

MESSAGE_SCHEMA_URL = 'https://raw.githubusercontent.com/wmo-im/wis2-notification-message/main/schemas/notificationMessageGeoJSON.yaml' # noqa
MESSAGE_SCHEMA_URL = 'https://raw.githubusercontent.com/wmo-im/wis2-notification-message/main/schemas/wis2-notification-message-bundled.json' # noqa
USERDIR = Path.home() / '.pywis-pubsub'
MESSAGE_SCHEMA = USERDIR / 'wis2-notification-message' / 'WIS2_Message_Format_Schema.yaml' # noqa
MESSAGE_SCHEMA = USERDIR / 'wis2-notification-message' / 'wis2-notification-message-bundled.json' # noqa


def sync_schema() -> None:
Expand Down
3 changes: 1 addition & 2 deletions pywis_pubsub/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

from pywis_pubsub import cli_options
from pywis_pubsub.schema import MESSAGE_SCHEMA
from pywis_pubsub.util import yaml_load

LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -58,7 +57,7 @@ def validate_message(instance: dict) -> Tuple[bool, str]:
raise RuntimeError(msg)

with open(MESSAGE_SCHEMA) as fh:
schema = yaml_load(fh)
schema = json.load(fh)

try:
validate(instance, schema)
Expand Down

0 comments on commit b5e5002

Please sign in to comment.