john-doherty / jsdoc-to-json-schema

Generate JSON schemas from JavaScript code comments using jsDoc @schema tag.
ISC License
11 stars 2 forks source link

schema not generated properly for nested properties #1

Open michalchochol opened 7 years ago

michalchochol commented 7 years ago

Hi John, thanks for great lib - works really good :) I have only one issue using it - can not generate proper schema for nested object property.

My jsdoc looks like this: /**

let Area = { /**

result schema is flat, but ex. "coordinates" should be property of "polygon":

{ "properties": { "id": { "title": "Name", "description": "Please enter your full name", "type": "string", "maxLength": 30, "minLength": 1 }, "name": { "type": "string", "required": true }, "osmId": { "type": "string", "required": true }, "polygon": { "type": "object", "required": true }, "$reql_type$": { "type": "string", "required": true }, "coordinates": { "type": "array", "required": true }, "type": { "type": "string", "required": true }, "simc": { "type": "string", "required": true }, "terc": { "type": "string", "required": true } }, "name": "Area" }

john-doherty commented 7 years ago

Hello. I've pulled in your example to use for development, I just need to give it some though but should be back to you shortly.

michalchochol commented 7 years ago

ok, thanks for help :)

Regards, Michał

W dniu 12.02.2017 o 20:51, John Doherty pisze:

Hello. I've pulled in your example to use for development, I just need to give it some though but should be back to you shortly.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/john-doherty/jsdoc-to-json-schema/issues/1#issuecomment-279243378, or mute the thread https://github.com/notifications/unsubscribe-auth/AMPCvVd_UBuZqj55kSVgNOvNS3v2PrORks5rb2LTgaJpZM4L-Avy.