Allow to export spec object
Description
It would be nice to be able to export the specification with which the code was generated as a variable. This could be done in either a new plugin or the schema plugin.
This would be useful for example for the fastify plugin, since the library used in the example for routing (fastify-openapi-glue) needs the specification for input/output validation.
I would be happy to create a PR if necessary.
So you'd be persisting the spec in your generated output?
That's right. The goal is to be able to have It at runtime, yes.
Does it need to be fully resolved? Thinking about multi-spec scenarios
I'm not sure I fully understand your point. As far as I know, @hey-api doesn't support multi-specs, right?
Yeah but that doesn't matter. I want to understand the scope of the feature for future reference. If we'd need to support multiple specs, then we'd do that 🤠
It makes sense 😅. In that case, if the system treats each spec separately, I would say that it would have to create a variable for each of the specs.