You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ah you’re right. This isn’t good. I think it’s because in many cases, when loading from a file or URL, you get a fresh copy of the schema object, so the mutation wasn’t noticed. But in Node.js this shouldn’t happen.
To be fair, the public API doesn't expect a readonly object, so it's kind of advertising that it could be dangerous. However, I don't think that's what anybody actually wants.
This issue happened when we started serializing the schema literal alongside the generated types so that we could export it as a TS as const.
This allows us to access enums from the schema with their literal types instead of the looser JSON-as-module types.
Description
openapiTS
mutates the schema object. ($ref
's mainly, it appears)Reproduction
JSON.stringify()
JSON.stringify()
againExpected result
Checklist
The text was updated successfully, but these errors were encountered: