Comments (9)
This seems to be really complicated to do right now because we still have work to have all generator generated by our generator.
I instead of using bin/run-all-petstore
we could have an other a sh script (bin/run-important-petstore
) that calls our most important bin/*.sh
scripts. The list could grow over time and at the end it could be similar to bin/run-all-petstore
.
After run of bin/run-important-petstore
, there should be no modification the git working tree, because all modifications should be included in the PR.
Maybe this will only run locally at the beginning (and not enforce at CI level), but this will be a good start giving more confidence when we work on stuff in DefaultCodegen
.
from openapi-generator.
currently all the scripts in bin/openapi3
also target samples/client/petstore
, so effectively they overwrite each other depending on which you choose.
from openapi-generator.
Definitely it's necessary and adding the check to CI is good enough for me.
I agree that some generators are not ready yet. We skip these in unit tests and so we can also skip it here too. I'm thinking about defining some kind of 'maturity level' for generators. If a technical committee decides that their generator is production-ready, they will add this to all tests cases.
from openapi-generator.
Ok what should be the list of mature generator that we want to use as input to force the update of samples/
folder?
from openapi-generator.
I have made great progress on a first version of a bin/ensure-up-to-date
script.
"Shippable CI" now as first step ensure that samples/
is up to date for a list of generators.
The list of bin/*.sh
scripts is defined in the bin/ensure-up-to-date
itself.
=> See PR #136
In my opinion the list scripts executed during this check can evolve over time. For the beginning, we should select:
- Mature generators.
- Generator supported by people doing PR review regularly (because if something evolves in a generated sample and feedback is requested on the PR to tell if it is good or bad).
I wanted to add more items to the list:
- generators used by a lot of users
- programming languages that are well known
But I have the feeling that those items are not measurable and will create too much debate...
Feel free to give your opinion.
from openapi-generator.
As mentioned in #136, we can keep this issue open and propose new PRs to add other generators in the list.
from openapi-generator.
Totally agree with adding the check. I'll add generator that I'm reviewing regularly to the list.
As mentioned in #80 (comment) , the list will grow over time and the target generator could be similar to run-all-petstore
.
When it comes, we need to consider running run-all-petstore
instead of {LANG}-petstore.sh
on the PR as only differences caused by the PR will be generated by run-all-petstore
.
from openapi-generator.
@macjohnny, @TiFu: I have noticed a lot of activity/review around the typescript generator.
If you are interested by the feature described here (checking with each PR that the generator runs and that its result included in a commit as part of the same PR to make the Shippable build green), feel free to add the necessary bin/*.sh
scripts in the list:
openapi-generator/bin/utils/ensure-up-to-date
Lines 12 to 27 in dcc0c17
from openapi-generator.
#4030 is an in-progress work to clean up the samples directory.
#3789 is an initial take on generating the samples in batch.
I think there are a few issues currently with generating the samples directory:
- It take a very long time to run the
ensure-up-to-date
script (attempting to address this with my batch PR) - We only overwrite previous files, we don't clean up old files… this means that a change in how we name files (either via code manipulation, or changes to yaml spec doc) may result in compilation errors that OSS contributors may not understand or care to spend time resolving on their PRs.
- People seem to find the output directory confusing; is it samples? is it regression tests? is it compilation tests?
- It's not all-inclusive. How do we know when a "sample" is ready to be considered a sample for the ensure-up-to-date script?
Speaking with @Fjolnir-Dvorak on Slack, I suggested that we may want to consider outputting the list of generated files to a text file under the .openapi-generator
directory (as we do currently with VERSION). We could automate recreation of samples using this output, and rather than having the samples.ci
directory which caches non-generated sources, we could make use of .openapi-generator-ignore
and persist these directly in the samples directory. To do this, we'd need:
- An opt-in option to write out the files created by the generator ( )
- A modification to ensure-up-to-date to delete files listed in the above file
- Change ensure-up-to-date to use the batch generation option
- Move all
sample.ci
files to their respective output directories, and adjust any relevant scripts - Update documentation
We could then use Github Actions to run ensure-up-to-date (I believe).
from openapi-generator.
Related Issues (20)
- [BUG][Clojure] Generated library imports non-existent specs
- Is it possible to generate a single .proto file? HOT 2
- [BUG][dart-dio] Using oneOf together with allOf does not generate properties
- [REQ] [Dart2] Allow specifying Locale or DateFormat
- Add support for Mint HOT 4
- [BUG][native][apache-httpclient] Generated code contains warnings in ApiClient HOT 1
- Go (client) is not able to generate code that compiles for allOf HOT 1
- [BUG][JAVA] - "ref" not works in open API code generator warn- o.o.codegen.utils.ModelUtils - #/../../../../.. is not defined.
- [REQ] Mutiny-Support for Jax-RS Quarkus Generator HOT 2
- PowerShell Generator creates code snippets but the apiNamePrefix is ignored in the code snippets
- merged spec caused null pointer exception
- [BUG][Python] client's `from_dict` and `to_dict` set optional but non-nullable fields to `None` HOT 2
- [BUG][Python] generate wrong allof class when the it has oneof nested inside HOT 1
- [BUG] [Python] to_json function raise error on date type HOT 2
- [BUG][Python] Schema property named _ (a single underscore) generates broken syntax HOT 6
- [BUG][Kotlin] openapi 3.0.3 allOf + description + nullable = intermediate class created
- [BUG] [typescript-angular] cannot compile with noUncheckedIndexedAccess set to true
- [BUG] [SPRING] Generation of JSonNullable for OpenApi 3.1 stops working from version 7.3
- [BUG] Spring boot 3 - can't see interfaces with default methods. "Ignored because not a concrete top-level class"
- [BUG] [C++] [Restbed] Post handler cannot fetch large request Body
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openapi-generator.