Re: How do I use swagger api to generate swagger with additionalProperties as false for object

2017-09-28 Thread Yuting
Yep I created an issue, thanks Ron! https://github.com/swagger-api/swagger-core/issues/2461 On Friday, September 29, 2017 at 12:16:54 PM UTC+10, Ron wrote: > > Yes, the 3.0.0 spec was changed to allow that. I’m not sure if we support > it yet in swagger-core 2.0. Mind filing a ticket? > > > >

Re: How do I use swagger api to generate swagger with additionalProperties as false for object

2017-09-28 Thread Ron Ratovsky
I know. I’m embarrassed to say that that’s my mistake too ☹ Regardless, it’s not going to change in the Swagger-provided tools. From: on behalf of Ben Sayers Reply-To: "swagger-swaggersocket@googlegroups.com"

Re: How do I use swagger api to generate swagger with additionalProperties as false for object

2017-09-28 Thread Ben Sayers
Fair enough. But perhaps the ship has sailed? A number of Swagger tools I have used allow booleans in additional properties and validate them correctly. For example the official json schema for Swagger 2 allows booleans in additional properties:

Re: How do I use swagger api to generate swagger with additionalProperties as false for object

2017-09-28 Thread Ron Ratovsky
Ben, I realize this is might sound a bit arrogant, but that’s not the intent. Being the person who wrote the Swagger 2 specification, and spent hours specifically on the Schema Object itself, I can assure you that the intent was as I stated before. This is a mistake in the wording of the

Re: How do I use swagger api to generate swagger with additionalProperties as false for object

2017-09-28 Thread Ron Ratovsky
Yes, the 3.0.0 spec was changed to allow that. I’m not sure if we support it yet in swagger-core 2.0. Mind filing a ticket? From: on behalf of Yuting Reply-To: "swagger-swaggersocket@googlegroups.com"

Re: How do I use swagger api to generate swagger with additionalProperties as false for object

2017-09-28 Thread Ben Sayers
I believe the Swagger 2 specification does indeed allow additional properties and that the default value is an empty schema. Here is my reasoning: This is the Swagger 2 definition for additional properties. The following properties are taken from the JSON Schema definition but > their

Re: How do I use swagger api to generate swagger with additionalProperties as false for object

2017-09-28 Thread Yuting
Thanks Ron for the response! Is it possible in swagger api 2.0.0-rc1? I explored a bit but didn't find many clue. The 3.0 spec does explicitly say value can be boolean though. - additionalProperties - Value can be boolean or object. Inline or referenced schema MUST be of a Schema

Re: How to reference the JSON schemas of objects from external sources (eg.GIT) into openapi yaml?

2017-09-28 Thread Ron Ratovsky
JSON References allow you to reference any http url. This is not about additional documentation, this is about using $ref to reference those. Keep in mind that if you’re using full JSON Schema, you won’t be able to reuse those in your Swagger definition as the specification does not support

Re: How do I use swagger api to generate swagger with additionalProperties as false for object

2017-09-28 Thread Ron Ratovsky
The 2.0 specification doesn’t allow setting additionalProperties: false. It was intended to be the default definition but was never clarified in the spec. From: on behalf of Yuting Reply-To:

How do I use swagger api to generate swagger with additionalProperties as false for object

2017-09-28 Thread Yuting
I somehow have to generate a swagger doc with addtionalProperties as false to not allow additional properties. I looked at https://github.com/swagger-api/swagger-core/blob/master/modules/swagger-models/src/main/java/io/swagger/models/ModelImpl.java but setAdditionalProperties accept a