x-apidog-refs (refs with hidden/overridden fields) missing in code generation
I
Ian Paterson
I have referenced schemas in a few places where it was necessary to hide or override the fields. This results in x-apidog-refs in the OpenAPI schema, but it seems that code generation is incompatible with this extension. Would it be possible to automatically dereference the x-apidog-refs before passing off to code generation so that it is operating on a standard OpenAPI spec?
One workaround for the user is to dereference when edits are necessary, but then we lose the benefit of sharing those refs. Changes made to the referenced schema are of course not reflected anywhere that it has been used but then dereferenced.
This was observed when using exported zod validators to check our data. The validation worked fine until we switched to strict mode which errors out if there are unexpected properties in the data. When doing so we noticed that several very important properties had not been generated in the zod validator. When any reference has been overridden with x-apidog-refs it is not included in code generation. Furthermore, even if the edits are reversed like hiding a field then unhiding it the x-apidog-refs extension remains.
Emily
Would you mind generating the code again using the web interface (https://app.apidog.com/project) to check if the issue remains? If possible, providing screenshots of the software's settings and the problematic code snippets would be extremely helpful in diagnosing the problem.We'll analyze this information as soon as possible.
I
Ian Paterson
Emily it works! Hiding or overriding part of a referenced schema now generates the correct code. Thank you for the quick fix =)