Feat/affichage swagger#1055
Conversation
when using asdf as node version manager, .tool-versions is required
5d5a086 to
c025711
Compare
Blocked by CORS, need to make a proxy in dev environment. Adds: - nuxt.config.ts: Vite dev proxy for entreprise.api.gouv.fr and particulier.api.gouv.fr - utils/openapi-proxy.ts: client-side URL rewriter that maps external swagger URLs to the local dev proxy paths
c025711 to
9f56088
Compare
nicolaskempf57
left a comment
There was a problem hiding this comment.
Thanks for your PR 🙏🏻
I'm not quite clear on the product /usability side. I find that having multiple banners reduce the purpose of the use of the banner component in the page.
| </div> | ||
|
|
||
| <div class="container space-y-4"> | ||
| <SimpleBanner |
There was a problem hiding this comment.
Could it be added to the existing banner in datagouv-components/src/components/OpenApiViewer/OpenApiViewer.vue ? Or moved to an AccordionGroup ? I find it strange to have many banners stacked
There was a problem hiding this comment.
The OpenAPI Viewer right now is for technical documentation, the current PR is aimed at providing non-tech with business (métier) information.
We could move to an AccordionGroup, I propose to ask @DorineLam for her input in UI/UX if the current up-to-3 banners stack is too much
There was a problem hiding this comment.
Hello, c'est possible pour vous de m'envoyer une preview ou au mini une capture écran ?
There was a problem hiding this comment.
C'est super. 🙌
De plus la bannière "Accéder à l'API" va disparaitre, on avait vu ça avec @thanhhale7 et @JeSuisUnCaillou.
Donc ce sera encore plus clair après avec juste deux accordéons : Données renvoyées et Swagger
|
Thanks, will correct all of that 👍 I just arrived on this product and still very junior on those stacks, so feedback is very welcome 🙏 |
Adds a recursive OpenApiProperty component and an OpenApiProperties wrapper that fetches the dataservice's OpenAPI YAML, extracts the response schema for the matching endpoint, and renders the fields as a structured property tree. Matching uses the dataservice title against endpoint summaries (Bouquet API Entreprise/Particulier conventions). Descriptions render as sanitized HTML via DOMPurify. A loader appears while the YAML is fetched and parsed client-side. The property tree is hosted in a collapsible "Données renvoyées" banner on the dataservice page, matching the existing Swagger banner's pattern.
9f56088 to
dae10e5
Compare
dae10e5 to
8477228
Compare
|
@nicolaskempf57 Do we want to merge or should we ping someone else for another review? |
8477228 to
f8a2284
Compare
Generalises the property tree to work with any OpenAPI 2.0 or 3.x spec, not just Bouquet API Entreprise/Particulier. A new utils/openapi-extract module resolves internal $ref pointers, flattens allOf, takes the first variant of oneOf/anyOf, and handles both v2 (responses.200.schema) and v3 (responses.200.content.application/json.schema) response locations. The Bouquet-specific data-wrapper unwrap and title-based filter become post-hoc transforms applied only when the title matches the Bouquet pattern. Non-Bouquet dataservices now render all endpoints with their HTTP method prefixed (GET, POST, ...) in the heading. The property tree banner loses its redundant heading and gets a white inner background.
DorineLam
left a comment
There was a problem hiding this comment.
J'approuve sur la base de la capture écran :) Merci @Samuelfaure


fix datagouv/data.gouv.fr#1906
1e3f3f8 is for testing, will drop before merge unless someone asks me not to
J'ai pas fait de JS ni de vue ni de typescript depuis un bail donc hésitez pas à me remonter les bretelles
Aussi pas testé car je suis pas sûr de votre politique de test mais je peux ajouter des tests
Note: je vais probablement remplacer le filtrage par nom de provider pour les bouquets API E/P avec un filtre coté API E/P