Closed rattrayalex closed 3 years ago
Hi @rattrayalex, can you point me the documentation of OpenAPI that the support of custom annotations?
I think this issue can be considered with #18.
The previous approach is taking JSON as intermediary between Joi and OpenAPI. However, since JSON schema does not have the flexibility to support custom attributes, maybe the direct conversion between Joi and OpenAPI is better.
Ah, sorry, they're called "Specification extensions" not "custom annotations". Basically you can have a field prefixed with x-
that has any value. For one example you can search for x-
in Stripe's openapi spec, there are many usages there.
I agree though that we should largely fold this into #18, I will discuss about openapi+json-schema there.
Supports in Version 2.0.0 and issue #18 is used to keep track of OpenAPI support.
Hello again,
OpenAPI lets you add custom annotations like so:
Is there a way to do this? I tried
joi.string().meta({'x-foo': 'bar'})
but it did not seem to work. I am not sure if it would make sense to passmeta
properties through in general.Thanks!