Open provokateurin opened 11 months ago
Having this code separate would also allow us to easily generate the api and the schema separately like:
core.openapi.dart
core.schema.dart
With the first one importing the later.
This might make larger specs both more readable and more performant to build (thinking about talk)
We still can't output two files in a single builder, so that won't work (but it would be pretty nice).
But if we have two builders we could chain them together in the build.yaml
Then we would still need two separate inputs I think
I think this is worth testing before going ahead with the issue.
I think this is possible with some build.yaml magic.
For the initial implementation I would just try to get this working. Afterwards we can improve our OpenAPI support by trying to separate the two steps.
I did have a look at this and the only limitation I found was our current code around reference resolving ($ref
).
We always pass the entire openapi spec arround in our resolving code while the only use is for reference resolving.
Our current reference resolving is very limited and needs to be rewritten. I tried a few ways to fix them but the only one that worked was a bit ugly.
Dynamite is already able to generate JSON schemas, but not directly from a JSON schema file. A second builder should be introduced to support this. Some code refactoring that separates the two features more is likely needed.