Open ptrkstr opened 1 month ago
Hey! Unfortunately, there isn't a way to set additional properties to false while using the Schemable
macro just yet. I hope to add this in the future, but need to put a bit more thought into it. It's trickier with the applicator keywords that apply subschemas, like additionalProperties
.
In the meantime, you can manually create the schema with the builders. Something like:
struct Person {
let name: String
}
extension Person: Schemable {
static var schema: JSONSchemaComponent {
JSONObject {
JSONProperty(key: "name") { JSONString() }
}
.disableAdditionalProperties()
}
}
Thanks for the quick reply @ajevans99 🙏 I appreciate you wanting to add it in the future and thank you for the alternative method, I will do that instead.
Hey @ajevans99, once again thank you for this fantastic package! I wanted to ask if there was a way to set
additionalProperties
(in my casefalse
) when using the@Schemable
macro. I wasn't able to find it in the source or tests but I may have missed it.