Skip to content

Commit 070b051

Browse files
committed
update GRIB/BUFR media types
1 parent d806c24 commit 070b051

File tree

8 files changed

+9
-9
lines changed

8 files changed

+9
-9
lines changed

.github/workflows/test-data/example-message.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"links": [
2424
{
2525
"rel": "canonical",
26-
"type": "application/x-bufr",
26+
"type": "application/bufr",
2727
"href": "https://pywis-pubsub-test.s3.eu-central-1.amazonaws.com/WIGOS_0-454-2-AWSCHIKANGAWA_20221109T135500.bufr4",
2828
"length": 247
2929
}

.github/workflows/test-data/pub-config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ broker: mqtt://localhost:1883
55
publish_topic: origin/a/wis2/mwi/malawi_wmo_demo/data/core/weather/surface-based-observations/synop
66

77
# application-type of file being published
8-
content_type: application/x-bufr
8+
content_type: application/bufr

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ from pywis_pubsub.publish import create_message
182182

183183
message = create_message(
184184
topic='foo/bar',
185-
content_type='application/x-bufr',
185+
content_type='application/bufr',
186186
url='http://www.meteo.xx/stationXYZ-20221111085500.bufr4',
187187
identifier='stationXYZ-20221111085500',
188188
datetime_=datetime.now(timezone.utc),

pywis_pubsub/util.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ def guess_extension(media_type: str) -> str:
198198
extension = None
199199

200200
wmo_extra_types = {
201-
'application/x-bufr': '.bufr4',
202-
'application/x-grib': '.grib2',
201+
'application/bufr': '.bufr4',
202+
'application/grib': '.grib2',
203203
'application/cap+xml': '.cap'
204204
}
205205

tests/test_invalid.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
{
2929
"href": "https://example.org/data/4Pubsub/92c557ef-d28e-4713-91af-2e2e7be6f8ab.bufr4",
3030
"rel": "canonical",
31-
"type": "application/x-bufr"
31+
"type": "application/bufr"
3232
}
3333
]
3434
}

tests/test_invalid_datetime.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
{
2929
"href": "https://example.org/data/4Pubsub/92c557ef-d28e-4713-91af-2e2e7be6f8ab.bufr4",
3030
"rel": "canonical",
31-
"type": "application/x-bufr"
31+
"type": "application/bufr"
3232
}
3333
]
3434
}

tests/test_malformed.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
{
3030
"href": "https://example.org/data/4Pubsub/92c557ef-d28e-4713-91af-2e2e7be6f8ab.bufr4",
3131
"rel": "canonical",
32-
"type": "application/x-bufr"
32+
"type": "application/bufr"
3333
}
3434
]
3535
}

tests/test_valid.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
{
3030
"href": "https://example.org/data/4Pubsub/92c557ef-d28e-4713-91af-2e2e7be6f8ab.bufr4",
3131
"rel": "canonical",
32-
"type": "application/x-bufr"
32+
"type": "application/bufr"
3333
}
3434
]
3535
}

0 commit comments

Comments
 (0)