Giter VIP home page Giter VIP logo

Comments (3)

zxchris avatar zxchris commented on May 18, 2024

Does Swagger/OpenAPI support oneOf now? It didn't: http://stackoverflow.com/questions/37713393/next-best-option-in-lieu-of-oneof-in-swagger-v2-0 and http://swagger.io/specification/#schemaObject

So long as it is supported by the go-openapi parser, then we can get it to work. There is an open issue about allOf not being completely supported by dapperdox, and we are rewriting the specification analysis to use more of go-openapi, which will improve, if not fix, the allOf compatibility.

from dapperdox.

x12a1f avatar x12a1f commented on May 18, 2024

Right, I forgot the Swagger/OpenAPI spec alters some of the JSON schema definitions. So I guess the answer is no and this issue can be closed.

from dapperdox.

IntegrationMike avatar IntegrationMike commented on May 18, 2024

Can we re-open this? Open API now supports oneOf but dapper does not appear to:
https://swagger.io/docs/specification/data-models/oneof-anyof-allof-not/

When I mimic that format:

"responses": {
  "200": {
    "description":"Text",
    "schema": {
      "oneOf":[
        {
          "$ref": "http://localhost:3123/definitions.json#/definitions/allowedParameters"
        },
        {
          "$ref": "http://localhost:3123/definitions.json#/definitions/calculatedPayment"
        }
      ]
    }
  },
}

I get
Error: POST /api/vehicles/allowedParameters references a model definition that does not have a title member.

Thank you!

Edit: Appears that oneOf is only valid for schema objects -- in this case, that's what I'm trying to do, so my case applies but the top level comment does not. I'll open a new Issue instead!

from dapperdox.

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.