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
-
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
Person
as part of a response, but I don't want to includesecret
.A couple potential solutions I can think of:
secret
in the response spec, but turn off strict validationsecret
, then returnPerson
's__format__
function to skipsecret
, which will eventually get called byjson.dumps
secret
when it encounters an instance ofPerson
I 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