Comments (14)
Related StackOverflow: http://stackoverflow.com/questions/30890933/nested-array-with-object-in-mson-is-empty-in-apiary-io-documentation/30893537
from drafter.
Thanks for the report @JeroenVdb. I am going to look into this now.
from drafter.
This is a bug in the parser itself. The generated MSON AST is not correct given the MSON.
from drafter.
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.
@JeroenVdb Apiary should have the bug fix as soon as we release the bug fix in here.
from drafter.
@pksunkara Is this the right snowcrash bug? Or is one filed?
from drafter.
@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.
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.
@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.
@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.
@pksunkara strange, they seem so similar, oh well I'll trust your expertise nullable
has been properly implemented into all the tools I'll start looking into danielgtaylor/aglio#155 unless somebody has already.
from drafter.
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.
@honzajavorek it probably is the same issue or at least it is fixed in the #199 PR as is this one.
from drafter.
@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)
- Enumerations contain duplicate values when you have a default/sample with different description HOT 1
- `"` in JSON values are not escaped correctly
- Missing resource name renders incorrect output but it is validated
- Confusing AST for enum examples HOT 4
- Compatibility with MSVC 2019 HOT 1
- Building drafter-cli causes a link "warning" (macOS)
- Duplicit value in enumeration HOT 2
- Missing description after wrongly interpreted MSON `enum[string], fixed`
- PEGTL not fixed to specific version HOT 1
- Drafter backend crashes on unexpanded `Include (object)` HOT 1
- sigsegv
- Include Drafter version in ABI HOT 2
- Parser emits that `false` is not allowed boolean type for default HOT 1
- Ninja can no longer build due to cycling input HOT 2
- Drafter version does not work for CMake builds
- Docker hub entry outdated HOT 1
- Distinct OneOf gets parsed as single OneOf group in schema HOT 5
- Fixed array with a mixin inside produces incorrect json schema
- Building drafter is painfully slow. HOT 3
- Drafter for Java
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from drafter.