Open atoff opened 1 year ago
Oof, just seeing this... it's not currently supported for responses. I'll put this on the radar, though.
@shalvah Are there any news if this is getting integrated soon? I think its pretty mandatory feature for generating a typescript API client.
Sorry, I've not had a chance to look at this. Quite busy these days.
I recommend sending in a PR if it's really needed. It isn't complex to implement, and I'll gladly review and merge.
@shalvah I added a PR: https://github.com/knuckleswtf/scribe/pull/814
Scribe version
4.19.0
Your question
Hello,
Really love this package by the way! I've been having some issues recently where I have been trying to use the OpenAPI schema generated by scribe for codegeneration clientside. The main issue is that I can't seem to find a way to make it generate a schema that respects that response fields are required in the output (i.e. not nullable/undefined). Essentially, I have this resource
being returned from this endpoint
This gives a nominal response type that looks like:
However, inside the OpenAPI schema generated by Scribe, the inner properties of the
data
object does not include the necessaryrequired
entry.Current OpenAPI Schema
Expected OpenAPI Schema
Am I missing something or is this not possible? I've trawled through the docs and can't seem to find a way to do this. Thanks!
Docs