but setAdditionalProperties accept a Property only, how do I set it with a boolean value?
| public void setAdditionalProperties(Property additionalProperties) { |
| type(OBJECT); |
| this.additionalProperties = additionalProperties; |
"TestDTO" : {
"type" : "object",
"additionalProperties":false
"properties" : {
"property1" : {
"description" : "This is a test object.",
"$ref" : "#/definitions/TestDTO"
},
"perperty2" : {
"type" : "string",
"description" : "this is a property."
}
}
},
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.
--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.
The following properties are taken from the JSON Schema definition but their definitions were adjusted to the Swagger Specification. Their definition is the same as the one from JSON Schema, only where the original definition references the JSON Schema definition, the Schema Object definition is used instead.
items
allOf
properties
additionalProperties
5.4.4. additionalProperties, properties and patternProperties
5.4.4.1. Valid values
The value of "additionalProperties" MUST be a boolean or an object.
If it is an object, it MUST also be a valid JSON Schema.
5.4.4.3. Default values
If either "properties" or "patternProperties" are absent, they can be
considered present with an empty object as a value.
If "additionalProperties" is absent, it may be considered present
with an empty schema as a value.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.
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?
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
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 spec which was never clarified properly – and it’s also the reason why the wording in the 3.0.0 spec around additionalProperties is much more explicit.
From: <swagger-sw...@googlegroups.com> on behalf of Ben Sayers <bsa...@atlassian.com>
Reply-To: "swagger-sw...@googlegroups.com" <swagger-sw...@googlegroups.com>
Date: Thursday, September 28, 2017 at 18:46
To: Swagger <swagger-sw...@googlegroups.com>
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.
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.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.