Skip to content

Add footer links to the API documentation - #80

Merged
mihailefter merged 7 commits into
masterfrom
feature/42-api-docs-link
Sep 8, 2026
Merged

Add footer links to the API documentation#80
mihailefter merged 7 commits into
masterfrom
feature/42-api-docs-link

Conversation

@mihailefter

Copy link
Copy Markdown
Collaborator

Add links to the FDP's API documentation in the footer, both Swagger UI and OpenAPI, visible on every page.

The client already discovers these via dcat:endpointDescription, and now reuses that discovery to expose the links. When no OpenAPI document can be resolved, a short warning is shown instead, matching the gap discussed in #64.

The "more prominent link only on the root page" suggestion was not implemented because the root page's own Endpoint description row already renders both URLs as working links, so adding another link there seemed redundant.

Fixes #42

@dennisvang dennisvang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @mihailefter this looks good overall, but I think it may be worth reconsidering the variable naming for clarity.

In essence we are trying to advertise two types of API documentation:

  • human readable (HTML)
  • machine readable (JSON)

Perhaps this could be reflected in a consistent way in the variable names and in the footer link labels?

Also perhaps check for <!doctype html> to identify a human readable document?

To identify the machine readable openapi doc, maybe isOpenApiDoc could check for the required openapi field in addition to the paths field. Note from the spec:

In addition to the required fields, at least one of the components, paths, or webhooks fields MUST be present.

Comment thread src/composables/apiDocs.ts
Comment thread src/composables/apiDocs.ts Outdated
Comment thread src/composables/apiDocs.ts Outdated
Comment thread src/composables/apiDocs.ts Outdated
Comment thread src/composables/apiDocs.ts Outdated
Comment thread src/App.vue Outdated
Comment thread src/App.vue Outdated
Comment thread src/App.vue Outdated
@mihailefter

Copy link
Copy Markdown
Collaborator Author

Hi @dennisvang! Thanks for the review. I've updated the variable names and footer labels to distinguish HTML and JSON consistently. isOpenApiDoc() now checks for both openapi and paths. For HTML detection, I used a successful response with Content-Type: text/html. This avoids inspecting the body. The HTML check runs now also separately so it does not delay application readiness.

Comment thread src/composables/apiDocs.ts Outdated

@dennisvang dennisvang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great @mihailefter
Well done, very thorough. 🙂
Thanks!

@dennisvang dennisvang added the feature New feature or feature request label Sep 8, 2026
@mihailefter
mihailefter merged commit 6b293ac into master Sep 8, 2026
7 of 9 checks passed
@dennisvang

Copy link
Copy Markdown
Collaborator

Hi @mihailefter I'm closing the branch to keep things clean.

@dennisvang
dennisvang deleted the feature/42-api-docs-link branch September 8, 2026 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or feature request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Link to API docs/swagger-ui

2 participants