Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support generating code for JSON schema files #933

Open
provokateurin opened this issue Oct 6, 2023 · 7 comments · May be fixed by #1964
Open

Support generating code for JSON schema files #933

provokateurin opened this issue Oct 6, 2023 · 7 comments · May be fixed by #1964
Assignees
Labels
feature New feature or request package: dynamite

Comments

@provokateurin
Copy link
Member

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.

@provokateurin provokateurin added feature New feature or request package: dynamite labels Oct 6, 2023
@provokateurin provokateurin self-assigned this Oct 6, 2023
@Leptopoda
Copy link
Member

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)

@provokateurin
Copy link
Member Author

provokateurin commented Oct 6, 2023

We still can't output two files in a single builder, so that won't work (but it would be pretty nice).

@Leptopoda
Copy link
Member

But if we have two builders we could chain them together in the build.yaml

@provokateurin
Copy link
Member Author

Then we would still need two separate inputs I think

@Leptopoda
Copy link
Member

I think this is worth testing before going ahead with the issue.

I think this is possible with some build.yaml magic.

@provokateurin
Copy link
Member Author

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.

@Leptopoda
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request package: dynamite
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants