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.

Open API Media Type drop down values

See original GitHub issue

Looking at this example https://www.http4k.org/blog/documenting_apis_with_openapi/

If I update the returning method to be returning(OK, Body.string(TEXT_PLAIN).toLens() to "Here's a drink", "A successful offer of a drink to the lowly meatbag.")

The spec generated still shows

      responses:
        '200':
          description: A successful offer of a drink to the lowly meatbag.
          content: {}

However I would’ve expected the following

responses:
        '200':
          description: A successful offer of a drink to the lowly meatbag.
          content: 
             text/plain:
                example: "Here's a drink"

Is there a reason it gets blanked out?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
daviddentoncommented, Jun 27, 2021

@jduffy3 Have made your changes, modified the tests slightly to add non-JSON examples… and all the tests passed ok (with expected changes). I also added support for request bodies which your changeset didn’t cover. Hopefully there will be no other effects. 😃

This will be released with 4.9.9.0

0reactions
jduffy3commented, Jun 28, 2021

Very cool! Thanks @daviddenton ! 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Media Types - Swagger
Media type is a format of a request or response body data. Web service operations can accept and return data in different formats,...
Read more >
Open API Spec3 - How to display a drop-down or a way to ...
My organization allows only 8 query parameters, we're using pagination, so page, size, sort (by multiple fields) and order (multiple fields).
Read more >
OpenAPI Specification v3.1.0 | Introduction, Definitions, & More
The OpenAPI Specification (OAS) defines a standard, programming language-agnostic interface description for HTTP APIs.
Read more >
Response "Content type" drop-down sets HTTP "Accept" header
Swagger-ui assumes that it should send an "Accept" header with a value of the selected content type with every request. This is not...
Read more >
What is the functionality of the 'Located In' drop down for ... - IBM
In the "Located in" drop-down field you define where the parameter can be found in the call of the operation that is specified...
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