question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Specifiying an example in the API docs using OpenAPI DSL

See original GitHub issue

I have code for an API endpoint, and I’d like the generated ReDoc documentation to contain an example response that I build. How do I do that?

So something like:

OpenApiBuilder.document().json("200", MyClass.class, openApiParam -> {
  openApiParam.description("OK.");
  openApiParam.example(new MyClass(3, "def"));
});

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:27 (27 by maintainers)

github_iconTop GitHub Comments

1reaction
sealedtxcommented, Jan 11, 2020

@tipsy Probably, I could spend some time on this task next week

0reactions
tipsycommented, Jan 25, 2020

Merged! Thanks for the help @sealedtx and @TobiasWalle !

Read more comments on GitHub >

github_iconTop Results From Across the Web

Specifiying an example in the API docs using OpenAPI DSL
I have code for an API endpoint, and I'd like the generated ReDoc documentation to contain an example response that I build.
Read more >
Making OpenAPI / Swagger Bearable With Your Own DSL
So writing a DSL (Domain Specific Language) for Open API just means creating a set of variables and functions that return hash maps....
Read more >
Using OpenAPI and Swagger UI - Quarkus
This guide explains how your Quarkus application can expose its API description through an OpenAPI specification and how you can test it via...
Read more >
Spring Boot + Swagger 3 (OpenAPI 3) Hello World Example
Swagger is a set of open-source tools built around the OpenAPI Specification that can help you design, build, document and consume REST APIs....
Read more >
OpenAPI Specification - Version 3.0.3 - Swagger
The OpenAPI Specification (OAS) defines a standard, language-agnostic interface to RESTful APIs which allows both humans and computers to discover and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found