Replies: 1 comment
-
|
Just my opinion, it seems to me this is kind of a general OpenAPI spec question, not so much a /Connexion/ question, which might explain why nobody answered here. Did you notice that Open API 3.0 defines a |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
What's a good way of skipping a member when serializing a response object?
Say I've got a class:
and I want to serialize an instance of
Personas part of a response, but I don't want to includesecret.A couple potential solutions I can think of:
secretin the response spec, but turn off strict validationsecret, then returnPerson's__format__function to skipsecret, which will eventually get called byjson.dumpssecretwhen it encounters an instance ofPersonI don't like (1) because it requires turning of strict validation. (2) and (3) would work but are rather inelegant. I'm leaning most toward (4).
Any thoughts?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions