diff --git a/engines/dfc_provider/app/services/enterprise_builder.rb b/engines/dfc_provider/app/services/enterprise_builder.rb index f29f79fca9..f4e612461e 100644 --- a/engines/dfc_provider/app/services/enterprise_builder.rb +++ b/engines/dfc_provider/app/services/enterprise_builder.rb @@ -21,6 +21,7 @@ class EnterpriseBuilder < DfcBuilder localizations: [address], phoneNumbers: [enterprise.phone].compact, socialMedias: SocialMediaBuilder.social_medias(enterprise), + logo: enterprise.logo_url(:small), # The model strips the protocol and we need to add it: websites: [enterprise.website].compact_blank.map { |url| "https://#{url}" }, @@ -31,7 +32,9 @@ class EnterpriseBuilder < DfcBuilder # But that would require a new endpoint for a single string. add_ofn_property(e, "ofn:contact_name", enterprise.contact_name) + # DEPRECATED: please use the standard `logo` attribute above. add_ofn_property(e, "ofn:logo_url", enterprise.logo_url(:small)) + add_ofn_property(e, "ofn:promo_image_url", enterprise.promo_image_url(:large)) end end diff --git a/swagger/dfc.yaml b/swagger/dfc.yaml index f75cd154dc..185edcb861 100644 --- a/swagger/dfc.yaml +++ b/swagger/dfc.yaml @@ -99,7 +99,6 @@ paths: - "@id": http://test.host/api/dfc/enterprises/10000 "@type": dfc-b:Enterprise dfc-b:hasAddress: http://test.host/api/dfc/addresses/40000 - dfc-b:logo: '' dfc-b:name: Fred's Farm dfc-b:hasDescription: Beautiful dfc-b:manages: http://test.host/api/dfc/enterprises/10000/catalog_items/10001 @@ -378,7 +377,7 @@ paths: dfc-b:email: hello@example.org dfc-b:websitePage: https://openfoodnetwork.org dfc-b:hasSocialMedia: http://test.host/api/dfc/enterprises/10000/social_medias/facebook - dfc-b:logo: '' + dfc-b:logo: http://test.host/rails/active_storage/url/logo.png dfc-b:name: Fred's Farm dfc-b:hasDescription: This is an awesome enterprise dfc-b:VATnumber: 123 456