Giter Site home page Giter Site logo

Comments (5)

jamidon avatar jamidon commented on May 19, 2024

I've traced it down into swaggerSpec.js in the createParamGroupSchemas() method. This method assumes each parameter's schema has the 'properties' property whereas the schema for an array parameter doesn't.

I'm wondering if I were possible to flatten out the array definitions to remove the $ref's if the jsonschema validate method would work.

Thoughts?

from swagger-routes.

mikestead avatar mikestead commented on May 19, 2024

Thanks for the details. I'm on a short break right now but will take a look next week when I'm back.

from swagger-routes.

jamidon avatar jamidon commented on May 19, 2024

from swagger-routes.

jamidon avatar jamidon commented on May 19, 2024

I found a way around this issue, and I'm fairly certain it has nothing to do with swagger-routes but the jsonschema module.

If I change the definition of the parameter in the add method from:

        "parameters": [
          {
            "name": "organization",
            "in": "body",
            "description": "organization(s) to add to the system",
            "required": true,
            "schema": {
              "$ref": "#/definitions/NewOrganizations"
            }
          }
        ]

to

        "parameters": [
          {
            "name": "organization",
            "in": "body",
            "description": "organization(s) to add to the system",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/NewOrganization"
              }
            }
          }
        ],

everything works as expected. Essentially the difference in the two definitions is the second one is a bit more explicit but otherwise seems equivalent to me.

Anyway, sorry for the noise.

from swagger-routes.

mikestead avatar mikestead commented on May 19, 2024

Good to hear, thanks for posting the solution 👍

from swagger-routes.

Related Issues (15)

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.