NickDotIo
3 years agoNew Contributor
Swagger open API spec
Hello all,
I have an API I've defined with swagger that has a custom JWT format. I'd like to tell my API clients what the format is so that they can include it in an HTTP header. I can do this manually in the API description tag. Example:
JWT format
Header
{
"alg": "HS256",
"typ:" "JWT"
}
Payload
{
"myPayload": "MyData"
}
But in order to be formatted this way, I need to describe it like this: <p> JWT format<p> Header<br>{<br> "alg": "HS256", <br> "typ": "JWT"<br>}<br>Payload<br>{ <br> "myPayload": "my data"<br>}
Is there a better way that uses the proper swagger/yaml tags to do this? I know of the security schema tags but these don't let me describe my JWT format very well.