Giter VIP home page Giter VIP logo

Comments (14)

JeroenVdb avatar JeroenVdb commented on May 27, 2024

Related StackOverflow: http://stackoverflow.com/questions/30890933/nested-array-with-object-in-mson-is-empty-in-apiary-io-documentation/30893537

from drafter.

pksunkara avatar pksunkara commented on May 27, 2024

Thanks for the report @JeroenVdb. I am going to look into this now.

from drafter.

pksunkara avatar pksunkara commented on May 27, 2024

This is a bug in the parser itself. The generated MSON AST is not correct given the MSON.

from drafter.

JeroenVdb avatar JeroenVdb commented on May 27, 2024

Super @pksunkara can you give a shout here when this is fixed?
How can I see if this is then used by the apiary.io editor?

from drafter.

pksunkara avatar pksunkara commented on May 27, 2024

@JeroenVdb Apiary should have the bug fix as soon as we release the bug fix in here.

from drafter.

alexturek avatar alexturek commented on May 27, 2024

@pksunkara Is this the right snowcrash bug? Or is one filed?

from drafter.

pksunkara avatar pksunkara commented on May 27, 2024

@alexturek No, that is a different bug. This is a drafter or drafter.js bug which needs to be fixed which is why it is created in drafter repo.

from drafter.

huiyiqun avatar huiyiqun commented on May 27, 2024

Please refer this: apiaryio/drafter.js#38

Working apib:

FORMAT: 1A

# Test nested arrays-in-object-arrays

A navigation has multiple categories. Each category can have multiple subcategories.

# GET /navigation

+ Response 200 (application/json)

    + Attributes

        + categories (array)
            + (object, fixed)
                + name: Category One (string) - Name of the category
                + subcategories (array)
                    + (object, fixed)
                        + name: Sub category One (string) - Name of the subcategory

OK, the schema works while the example not when I compiled it with aglio.

However, fixed means that there could not be any additional attributes in the nested objects, this may be a problem.

from drafter.

obihann avatar obihann commented on May 27, 2024

@pksunkara I mentioned this in a an apiary issue ( danielgtaylor/aglio#155), would you agree this is the same issue?

Also, I'm more than happy to help out on this, just point me in the right direction. I know we spoke of this earlier but now that I am far more familiar with the drafter codebase I can probably understand the issue better.

from drafter.

pksunkara avatar pksunkara commented on May 27, 2024

@obihann No, this issue is completely different. The blueprint is not correctly being parsed at all in this issue while danielgtaylor/aglio#55 is about JSON Schema rendering.

from drafter.

obihann avatar obihann commented on May 27, 2024

@pksunkara strange, they seem so similar, oh well I'll trust your expertise 👍. Once nullable has been properly implemented into all the tools I'll start looking into danielgtaylor/aglio#155 unless somebody has already.

from drafter.

honzajavorek avatar honzajavorek commented on May 27, 2024

Just to verify, is this issue also about following problem or is my problem a new thing?

Input:

...
+ dimensions (array)
  + *20, 30, 40* (array[number], fixed)
...

Generated JSON:

{
  ...
  "dimensions": [],
  "20, 30, 40": [ null ],
  ...
}

Expected JSON:

{
  ...
  "dimensions": [ [20, 30, 40] ],
  ...
}

from drafter.

w-vi avatar w-vi commented on May 27, 2024

@honzajavorek it probably is the same issue or at least it is fixed in the #199 PR as is this one.

from drafter.

w-vi avatar w-vi commented on May 27, 2024

@JeroenVdb It has been fixed a while ago can you verify? I am closing this one, if it doesn't work for you feel free to reopen

from drafter.

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.