Giter VIP home page Giter VIP logo

Comments (1)

javierbrea avatar javierbrea commented on June 12, 2024

Hi @yarinsa ,
The remote example fails to create the response for the 300 status code because it is defined in a string, which is something that the openapi plugin does not support, but the rest of routes are created successfully.

Wrong variant causing the route / to not be created in the remote example:

"300": {
            "description": "300 response",
            "content": {
              "application/json": {
                "examples": {
                  "foo": {
                    "value": "{\n \"versions\": [\n       {\n         \"status\": \"CURRENT\",\n         \"updated\": \"2011-01-21T11:33:21Z\",\n         \"id\": \"v2.0\",\n         \"links\": [\n             {\n                 \"href\": \"http://127.0.0.1:8774/v2/\",\n                 \"rel\": \"self\"\n             }\n         ]\n     },\n     {\n         \"status\": \"EXPERIMENTAL\",\n         \"updated\": \"2013-07-23T11:33:21Z\",\n         \"id\": \"v3.0\",\n         \"links\": [\n             {\n                 \"href\": \"http://127.0.0.1:8774/v3/\",\n                 \"rel\": \"self\"\n             }\n         ]\n     }\n ]\n}\n"
                  }
                }
              }
            }
          }

Response of http://localhost:3100/openapi/v2 using the remote example:

{
  "version": {
    "status": "CURRENT",
    "updated": "2011-01-21T11:33:21Z",
    "media-types": [
      {
        "base": "application/xml",
        "type": "application/vnd.openstack.compute+xml;version=2"
      },
      {
        "base": "application/json",
        "type": "application/vnd.openstack.compute+json;version=2"
      }
    ],
    "id": "v2.0",
    "links": [
      {
        "href": "http://127.0.0.1:8774/v2/",
        "rel": "self"
      },
      {
        "href": "http://docs.openstack.org/api/openstack-compute/2/os-compute-devguide-2.pdf",
        "type": "application/pdf",
        "rel": "describedby"
      },
      {
        "href": "http://docs.openstack.org/api/openstack-compute/2/wadl/os-compute-2.wadl",
        "type": "application/vnd.sun.wadl+xml",
        "rel": "describedby"
      },
      {
        "href": "http://docs.openstack.org/api/openstack-compute/2/wadl/os-compute-2.wadl",
        "type": "application/vnd.sun.wadl+xml",
        "rel": "describedby"
      }
    ]
  }
}

So, for the moment I will change the example in the docs to a completely supported openapi example, and I will also let this issue open for supporting json stringified examples.

from main.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.