Include DFC context in spec example

The DFC Prototype does include the context while the output of the DFC
Connector refers to the URL of the published context. While that's more
efficient, it's also brittle because the context is updated from time to
time. That happened three days ago and working with the newly published
context breaks our integration until we get an updated version of the
DFC Connector containing the new URLs for datatypes.
This commit is contained in:
Maikel Linke
2023-07-03 13:27:24 +10:00
parent 7b9e4f6914
commit 7dc6cb151d
2 changed files with 9 additions and 2 deletions

View File

@@ -30,7 +30,11 @@ describe "SuppliedProducts", type: :request, swagger_doc: "dfc-v1.7/swagger.yaml
# supply it. I couldn't do it with rswag when requiring it.
parameter name: :supplied_product, in: :body, required: false, schema: {
example: {
'@context': "http://static.datafoodconsortium.org/ontologies/context.json",
'@context': {
'dfc-b': "http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#",
'dfc-m': "http://static.datafoodconsortium.org/data/measures.rdf#",
'dfc-pt': "http://static.datafoodconsortium.org/data/productTypes.rdf#",
},
'@id': "http://test.host/api/dfc-v1.7/enterprises/6201/supplied_products/0",
'@type': "dfc-b:SuppliedProduct",
'dfc-b:name': "Apple",

View File

@@ -308,7 +308,10 @@ paths:
application/json:
schema:
example:
"@context": http://static.datafoodconsortium.org/ontologies/context.json
"@context":
dfc-b: http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#
dfc-m: http://static.datafoodconsortium.org/data/measures.rdf#
dfc-pt: http://static.datafoodconsortium.org/data/productTypes.rdf#
"@id": http://test.host/api/dfc-v1.7/enterprises/6201/supplied_products/0
"@type": dfc-b:SuppliedProduct
dfc-b:name: Apple