diff --git a/engines/dfc_provider/README.md b/engines/dfc_provider/README.md index f3effcbaac..e8f5771f21 100644 --- a/engines/dfc_provider/README.md +++ b/engines/dfc_provider/README.md @@ -3,45 +3,17 @@ This engine implements the [Data Food Consortium] specifications. It serves and reads semantic data encoded in JSON-LD. +The API is documented with Swagger at `/api-docs`. You can update these docs +with: + +``` +./script/rswag engines/dfc_provider +``` + +More documentation by the Data Food Consortium: + +* https://datafoodconsortium.gitbook.io/dfc-standard-documentation/semantic-specifications/business-ontology +* https://datafoodconsortium.gitbook.io/dfc-standard-documentation/appendixes/practical-examples/version-1.7.3 +* https://github.com/datafoodconsortium/ontology/tree/master/ontologies + [Data Food Consortium]: https://github.com/datafoodconsortium - -## Authentication - -The DFC uses OpenID Connect (OIDC) to authenticate requests. You need an -account with a trusted OIDC provider. Currently these are: - -* https://login.lescommuns.org/auth/ - -But you can also authenticate with your OFN user login (session cookie) through -your browser. - -And you can also use your OFN API token in the HTTP header. For example: - -``` -X-Api-Token: d6ccf8685b8cd29b67ae6186e9ceb423bd2ac30b7c880223 -``` - -## API endpoints - -The API is under development and this list may be out of date. - -``` -/api/dfc-v1.7/persons/:id - * show: firstName, lastName, affiliatedOrganizations - -/api/dfc-v1.7/enterprises/:id - * show: name, suppliedProducts, catalogItems - -/api/dfc-v1.7/enterprises/:enterprise_id/supplied_products (index) - -/api/dfc-v1.7/enterprises/:enterprise_id/supplied_products/:id - * create: name, description, quantity - * show: name, description, productType, quantity - * update: description - -/api/dfc-v1.7/enterprises/:enterprise_id/catalog_items (index) - -/api/dfc-v1.7/enterprises/:enterprise_id/catalog_items/:id - * show: product, sku, stockLimitation, offers (price, stockLimitation) - * update: sku, stockLimitation -``` diff --git a/engines/dfc_provider/spec/swagger_helper.rb b/engines/dfc_provider/spec/swagger_helper.rb index 4dee496e63..7de36d7a64 100644 --- a/engines/dfc_provider/spec/swagger_helper.rb +++ b/engines/dfc_provider/spec/swagger_helper.rb @@ -12,13 +12,25 @@ RSpec.configure do |config| title: 'OFN DFC API', version: 'v0.1.7' }, + description: <<~HTML, +
+ This API implements the Data Food Consortium (DFC) specifications. + It serves and reads semantic data encoded in JSON-LD. +
+ Unfortunately, this description does not appear in the Swagger UI. :-( + HTML components: { securitySchemes: { oidc_token: { type: :http, scheme: :bearer, bearerFormat: "JWT", - description: "OpenID Connect token from a trusted platform" + description: <<~HTML + OpenID Connect token from a trusted platform: +
+ This API implements the Data Food Consortium (DFC) specifications. + It serves and reads semantic data encoded in JSON-LD. +
+ Unfortunately, this description does not appear in the Swagger UI. :-( components: securitySchemes: oidc_token: type: http scheme: bearer bearerFormat: JWT - description: OpenID Connect token from a trusted platform + description: | + OpenID Connect token from a trusted platform: +