Closed mewren closed 9 years ago
The relevant packages that are involved are bootprint-swagger
, bootprint-json-schema and bootprint-base.
They depend on each other in this order. From your screenshot I believe the problem might be with bootprint-json-schema
. If you are brave and want to find the bug yourself, you could look into the call tree of the handlebars-partials. The json-schema-partials are not very well documented though.
Starting with bootprint@0.4.10 the versions of the used template packages (-swagger ,-json-schema, -base) should be printed on startup, so that might give some hints too.
If it is possible, you could also post your swagger-spec here and let me have a look.
And, if this were possible in writing, you could see me smile. I'm flattered that there are always new people asking questions, I wasn't expecting that when I started this project.
I un-installed then re-installed the specific versions to try to match my co-worker: npm -g install bootprint-base@0.5.0 npm -g install bootprint-json-schema@0.5.0 npm -g install bootprint-swagger@0.6.2
Now I get printed on startup: Loading bootprint-swagger 0.6.2 Loading bootprint-json-schema 0.5.1 Loading bootprint-base 0.5.1 done
I can't share my spec. Still don't know why the spec works for some of us, but not others. I tried PetStore yaml and it works, so will have to rip out sections until it works. Fun fun.
What I would do is the following:
bootprint-swagger
locally, you can then invoke the local version by changing into its directory and calling bootprint . <path-to-spec> target/
node_modules/handlebars/partials/json-schema/body.hbs
. That file renders the contents of one definition box. {{json .}}
at any place inside the file and call bootprint
. This will pretty-print the current context as json, so you can see what objects the partial is working with.Looking at the file, I may have an idea. Stupid thing... This part is probably responsible for it.
{{#if $ref}}
{{>json-schema/reference $ref}}
{{else ifeq type 'object'}}
{{>json-schema/properties}}
{{#if additionalProperties}}
{{>json-schema/additionalProperties additionalProperties}}
{{/if}}
{{else ifeq type 'array'}}
{{>json-schema/array-items items}}
{{else}}
{{>json-schema/datatype .}}
{{/if}}
You don't have explicitly set type: object
on your definition, do you? Then this will only print the object
.
The part changed in the last release of bootprint-json-schema
due to #18
I'm looking into it right now. I think I have a solution, but I'm currently having some side-effects
Make sure you now use bootprint-json-schema@0.5.2
, which I have just published. It should resolve the bug. Can you verify that?
I'm closing this issue. If you have any more problems, please either comment here or create a new issue. I hope I could help you.
My Definition objects are mostly blank.
When I send my yaml file to a co-worker who is on an older version(0.6.2), it works fine for him. Another co-worker on the newer version has the same problem as me (0.6.5) I tried uninstalling and reinstalling to bootprint (0.7.1)and bootprint-swagger to (0.6.2) but I still get the same error, so I suspect it is another dependency that is causing the problem?
Suggestions?