From 6266df5c769b4c26a288241e9f5155fef99e298a Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Wed, 15 Nov 2023 14:59:15 +1100 Subject: [PATCH] Add long description to DFC Enterprise API --- engines/dfc_provider/app/services/enterprise_builder.rb | 6 +++++- swagger/dfc.yaml | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/engines/dfc_provider/app/services/enterprise_builder.rb b/engines/dfc_provider/app/services/enterprise_builder.rb index 46ad5eb2c9..aff8ece70f 100644 --- a/engines/dfc_provider/app/services/enterprise_builder.rb +++ b/engines/dfc_provider/app/services/enterprise_builder.rb @@ -15,7 +15,11 @@ class EnterpriseBuilder < DfcBuilder suppliedProducts: supplied_products, catalogItems: catalog_items, localizations: [address], - ) + ).tap do |e| + e.registerSemanticProperty("ofn:long_description") do + enterprise.long_description + end + end end def self.enterprise_group(group) diff --git a/swagger/dfc.yaml b/swagger/dfc.yaml index 700285d22d..3602c1a28d 100644 --- a/swagger/dfc.yaml +++ b/swagger/dfc.yaml @@ -99,6 +99,7 @@ paths: dfc-b:hasDescription: Beautiful dfc-b:manages: http://test.host/api/dfc/enterprises/10000/catalog_items/10001 dfc-b:supplies: http://test.host/api/dfc/enterprises/10000/supplied_products/10001 + ofn:long_description: "

Hello, world!

This is a paragraph.

" - "@id": http://test.host/api/dfc/enterprises/10000/catalog_items/10001 "@type": dfc-b:CatalogItem dfc-b:references: http://test.host/api/dfc/enterprises/10000/supplied_products/10001 @@ -322,6 +323,7 @@ paths: dfc-b:VATnumber: 123 456 dfc-b:manages: http://test.host/api/dfc/enterprises/10000/catalog_items/10001 dfc-b:supplies: http://test.host/api/dfc/enterprises/10000/supplied_products/10001 + ofn:long_description: "

Hello, world!

This is a paragraph.

" dfc-b:affiliates: http://test.host/api/dfc/enterprise_groups/60000 - "@id": http://test.host/api/dfc/addresses/40000 "@type": dfc-b:Address