-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
Generate for spec changes #96
Generate for spec changes #96
Conversation
… clean up duplicated dependency,
expect( | ||
generator.getGeneratorNameFromEnum(n.Generator.dart), equals('dart')); | ||
}); | ||
}); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested as part of the GeneratorArguments test suite
openapi-generator/lib/src/determine_flutter_project_status.dart
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added new config options, added deprecations
'--type-mappings=package=type' | ||
])); | ||
}); | ||
test('uses config', () async { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure how best to test this. I need to build a constantreader
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test the jarargs? Just confirming it generates the right command should be enough
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is mostly to ensure that the expected values are injected correctly.
openapi-generator/test/utils.dart
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bunch of refactoring
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Provides a typed api to interact with through out the builder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bulk of the next gen support
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This required a lot of changes to clean up the processing of things, more work is to be done still
@gibahjoe Do you know an easy way to gather the reader? I want to ensure that the GeneratorArguments class parses the config as expected. |
Take a look at this test library which provides useful utility methods source_gen_test. I guess, you can use this method to generate a library reader Have not tested it myself though. |
…k the classes from annotations to have the toMap call, Look into why inline schema name mappings failing to produce first entry
@gibahjoe 2 things:
|
You can leave that. I will let this pr go if all other checks pass.
That file is meant to be in the repo. Must have been removed by mistake. You can see the unignore line here. Please add it back. |
@gibahjoe The jar is unable to find the spec when the path exists. I've tried relative and absolute paths. Is this something you've run into? It seems like the jar is up to date
It's not something I removed but i believe it should get generated and I will add it back once I can get it generating again. |
@Nexushunter |
I'm running |
Sorry, just seeing this. Have you figured out the issue? these config look fine to me |
No worries! I have not, I spent some time scouring the net and couldn't find an issue for this (outside of a docker issue, which isn't being used here). As far as I'm aware the jar is throwing the error. I also went and pulled down a new copy of the jar with no luck. I'm super confused 🤔 I will double check but I'm almost certain it's not a directory permission either. |
Ok, so it seems that it is definitely something happening during the processing as I ran |
I found a solution. It seems like the space was being added. So I swapped out the space for an |
@gibahjoe The checks should pass now. I was able to get it all building locally. |
@gibahjoe 🎉🎉 it's finally passing so excited for this! Thanks for being so patient and responsive with everything! |
Great work. I am running a few manual checks to ensure everything is great. Thank you for this. |
Just a few more hurdles to jump through. Kindly check my reviews. Again, I appreciate the effort. |
@gibahjoe I'm not seeing them. Are you referring to the comment above about testing the jarArgs? |
Not that. |
@gibahjoe This is what I'm seeing. I did readd the pubspec as requested (which is why the flutter example passed) and the rest of the messages are about getting the config to run. Could you list out what is missing / wrong? As an aside: I am currently looking into why there isn't as many logs coming through as I would expect. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
Please add some documentation that "useNextGen" flag would be removed in the future and next gen would be the default mode.
-
A modification to the annotation is still required for the sourcegen framework to trigger the openapi generator (which in turn then checks for diff between cache spec and local spec).
Is this the desired behavior?
For example:- If you rundart run build_runner build --delete-conflicting-outputs
and the generator kicks in then make changes to your spec and run it again, the generator won't kick in again until changes are made to the annotation itself. -
I made some changes to a spec but the generator still does not run ( I get
No diff between versions, not running generator
). Perhaps a regular JSON string comparison will be more thorough when checking for diffs? The specific change I made was to add a model under component schema
openapi-generator-annotations/lib/src/openapi_generator_annotations_base.dart
Show resolved
Hide resolved
My bad. I forgot to submit the reviews |
…run. Add documentation around the usage of useNextGen, add tests
@gibahjoe I've added the work around and made the require compare and doc tweaks 🎉 |
Perfect. LGTM. You have done an awesome job. |
@gibahjoe All fixed! Thanks! I appreciate that 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great.
Thank you for your changes. I see that you deprecated |
Np! Yes 😄 that is the recommendation. With useNextGen it opens up a path to use incremental updates to the oas spec. It does have some current limitations around remote specs (only public are supported) but I do have a WIP to address that issue. |
Thank you 🙏 🙌 |
Description
Currently the openapi-generator doesn't rerun when the oas spec changes. This prevents incremental changes to the oas spec, making it a requirement to make hacky changes. To alleviate this storing a copy of the oas spec in the build directory allowing for changes to be diffed. Another option is to use git. It should also not require flutter and should allow for dart only if the pubspec doesn't include the flutter SDK as a dependency.
Boyscouting:
Acceptance Criteria