Skip to content

Commit

Permalink
Merge pull request #127 from autermann/fix/101
Browse files Browse the repository at this point in the history
add example for observation with PNG image result
  • Loading branch information
autermann authored Feb 20, 2025
2 parents 22bab68 + 4240909 commit 6823ccb
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"obsFormat": "application/json",
"resultLink": {
"mediaType": "image/png"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"obsFormat": "application/json",
"resultLink": {
"mediaType": "image/png"
}
}
23 changes: 22 additions & 1 deletion api/part2/openapi/schemas/json/observationSchemaJson.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,30 @@
"resultSchema": {
"description": "Schema for the observation `result` property. This describes the observed properties included in the result and how they are structured if the result is a record, a vector quantity or a coverage.",
"$ref": "../common/sweCommonDefs.json#/definitions/AnyComponent"
},
"resultLink": {
"description": "Encoding information in case the result is provided out-of-band via the `result@link` property.",
"type": "object",
"properties": {
"mediaType": {
"description": "Media type of out-of-band resources obtained by dereferencing the result links",
"type": "string"
}
},
"required": [ "mediaType" ]
}
},
"required": [
"obsFormat", "resultSchema"
"obsFormat"
],
"oneOf": [
{
"title": "Inline Result",
"required": [ "resultSchema" ]
},
{
"title": "Result Link",
"required": [ "resultLink" ]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ This is an example schema for vector observations:
----
include::../openapi/examples/schemas/observationSchema-vector-json.json[]
----
This third example has an out-of-band PNG image as the result:
[source%autofit,json]
----
include::../openapi/examples/observations/observationSchema-image-link.json[]
=================

NOTE: All other observation properties are the same for all datastreams and thus described in the static schema provided in <<clause-json-observation>>.
Expand Down Expand Up @@ -143,6 +148,12 @@ This second observation has a vector result type:
----
include::../openapi/examples/observations/obs-location.json[]
----
This third observation has PNG image as a result type that is a PNG image encoded inline as a `data:` URL
[source%autofit,json]
----
include::../openapi/examples/observations/obs-link-inline-image.json[]
----
=================


Expand Down

0 comments on commit 6823ccb

Please sign in to comment.