Skip to content

Conversation

@lcaouen
Copy link
Contributor

@lcaouen lcaouen commented Nov 28, 2025

I have found a better way to add the open-api documentation to the phoebus documentation
With the old way, the service had to be running in a CI to get the swagger.json and then possibly added to the documentation
#3124

With this pull request, the swagger.json is generated in the mvn compilation thanks to the plugin https://kbuntrock.github.io/openapi-maven-plugin.
I have also added an extension to sphinx to ignore the open-api documentation if the swagger.json is missing.
Everything can now be done locally.

Tested manually by @lcaouen and @minijackson

Swagger documentation is then included and used in the Phoebus documentation using a safe directive
@lcaouen lcaouen force-pushed the new_swagger_generation branch from 9debf9a to c173695 Compare November 28, 2025 15:22
@lcaouen lcaouen force-pushed the new_swagger_generation branch from c173695 to e08d6f1 Compare November 28, 2025 15:23
@jacomago
Copy link
Contributor

Very nice, any possibility you could do something similar in ChannelFinder?

Copy link
Collaborator

@georgweiss georgweiss left a comment

Choose a reason for hiding this comment

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

Maybe I am missing something in regards to how this is supposed to work. After running the doc build, I cannot find anything swagger related in the generated output. Maybe I am looking in the wrong place.

@lcaouen
Copy link
Contributor Author

lcaouen commented Dec 1, 2025

This PR concerns only phoebus\services\alarm-logger
A new plugin openapi-maven-plugin has been added to the pom.xml
This plugin will generate spec-open-api.json in the target subdirectory
This json is then used by services\alarm-logger\doc\index.rst where there is a directive .. safe_openapi:: ../../../../../services/alarm-logger/target/spec-open-api.json at the end fo the file
If the file is not found, the doc will display a message that the file is missing otherwise the swagger is displayed

image

@georgweiss
Copy link
Collaborator

Thanks @lcaouen for the clarification. Looks good, nice way of consuming open API annotations. I will use this for save-and-restore...

@georgweiss georgweiss merged commit 770f350 into ControlSystemStudio:master Dec 1, 2025
2 checks passed
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.

3 participants