0

I was write file openapi.yml wth openapi 3.0 description for services in my helidon project. But I use standart helidon handlers too (health and metrics):

return Routing.builder()
   .register(JsonSupport.create())
   .register("/api/files", health)     
   .register("/api/files", metrics)    
   .register("/api/files/storage", fileService)
   .register("/api/files", OpenAPISupport.create(config))
   .build();

How make section for health and metrics in my openapi.yml? I use:

<dependency>
   <groupId>io.helidon.openapi</groupId>
   <artifactId>helidon-openapi</artifactId>
   <version>1.3.1</version>
</dependency>

1 Answers1

1

There are two ways you can do this:

  1. Simply add the /health and /metrics endpoint information to the openapi.yml file you already created.
  2. Add your own implementation of the MicroProfile OpenAPI OASModelReader interface to your application that adds the health and metrics information programmatically. You also set a configuration value to tell the system about your implementation. Please see https://helidon.io/docs/latest/index.html#/openapi/01_openapi for the details.

Unfortunately, there is not currently any automatic way to add OpenAPI information about health and metrics to your application's OpenAPI document.

Further information (I seem to have misinterpreted the original question):

The /metrics and /health endpoints are implemented by Helidon, but the MicroProfile Metrics and Health specifications dictate the paths for and the behavior of those endpoints.

Some relevant documents to get you started:

metrics:

health:

Tim Quinn
  • 146
  • 4
  • Thank you for help, Tim. You help me with helidon documentation second time. Of course, I can add this endpoints in `openapi.yml` by hands. And I made it, [result](https://app.swaggerhub.com/apis-docs/ITTest5/Image-service). But I want good documentation with valid json schemas and status (like section files). Files endpoint I programming himself and know about schemas and status. Health and metrics is helidon endpoint. Where can I get information about it for documentation? – Prostakov Alexey Jun 02 '20 at 07:57
  • Updated my original answer to reflect the clarified question. – Tim Quinn Jun 02 '20 at 12:05
  • Thank you for documents reference. These are complex but detailed documents, I will understand them over time. – Prostakov Alexey Jun 02 '20 at 13:27