Skip to content

Fixed and enhanced OpenAPI: Copilot#218

Merged
adriendupuis merged 1 commit intoenh-openapifrom
enh-openapi-tmp
Apr 22, 2026
Merged

Fixed and enhanced OpenAPI: Copilot#218
adriendupuis merged 1 commit intoenh-openapifrom
enh-openapi-tmp

Conversation

@adriendupuis
Copy link
Copy Markdown
Contributor

@adriendupuis adriendupuis commented Apr 22, 2026

🎫 Issue IBX-XXXXX

Related PRs:

Continue #195 with the help of Copilot for the repetitive part.

copilot -p 'Please, read and execute the prompt from @prompt.md' --allow-tool='write'

prompt.md:

Hey,

Find REST controllers in those directories if they exist:
- @./src/lib/Server/Controller
- @./src/bundle/Controller/REST
- @./src/bundle/Controller/Rest

Check for API Platform OpenAPI documentation attributes.

If there is a requestBody, check that it has a description, if not:
- when the requestBody content isn't empty, add a description guessed from Content-Type header's description or requestBody mimetypes
- when the requestBody content is empty, add as description 'No payload required'
If it's a Post method without a requestBody, add a requestBody with description 'No payload required' and empty ArrayObject as content.

If the responses' HTTP_OK or HTTP_CREATED are missing a description, add the description from the Accept header.

For requestBody and responses mimetypes, if there is x-ibexa-example-file, check that this example corresponds to the mimetype they're used for.
If not, check if an example file exists by toggling between XML and JSON.
- If such file exists, fix the x-ibexa-example-file path;
- if there is no such file, remove the x-ibexa-example-file without leaving anything.

If there is a If-None-Match header, ensure it's not required.

Remove from parameters Content-Type and Accept headers. If parameters is an empty array, remove it without leaving anything, not even a comment.

Keep the code nicely formatted.

Don't create any file, just edit the existing PHP files.

Thank you!

Description:

For QA:

Documentation:

@sonarqubecloud
Copy link
Copy Markdown

@adriendupuis adriendupuis merged commit 4ebf91d into enh-openapi Apr 22, 2026
8 of 13 checks passed
@adriendupuis adriendupuis deleted the enh-openapi-tmp branch April 22, 2026 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants