Comments (5)
There are two approaches that we could take here:
Add inversion to split
This would keep the -s
/--split
flag but also introduce an inversion called --no-split
.
If you ran the generator without specifying -s
/--split
then it would result in an error:
$ create-api generate schema.json
Error: Missing one of: '--split', '--no-split'
Help: --split <split> Split output into separate files
Pros: Forces the users who didn't previously split to make a conscious decisions on the behaviour that they want
Cons: One extra flag that needs to be provided
Deprecate split
and introduce mergeSources
For people using --split
, we'd log a warning that the property was deprecated (and now the default behaviour), but for those not using --split
, it will result in a change in generator behaviour.
Pros: Makes splitting the default behaviour
Cons: Breaking change
I think that I'm leaning towards a two-step change:
- Add the
--split
inversion to force people to make a conscious decision in 0.1.0 - Deprecate
--split
and--no-split
in favour of--merge-sources
in a future release
The result here is that there are no unexpected surprises if you don't read the release notes. If you want to continue merging your sources, you see an error, append --no-split
and continue about your day. If you were already using --split
, it makes no difference.
Then in a future update, we introduce --merge-sources
and deprecate --split
/--no-split
, log a warning for a release or two and then remove the options.
from createapi.
Removing the 0.1 milestone since this will be a longer-term project. The first phase however is going into 0.1 (see PR above)
from createapi.
In my opinion, since the release state of the project isn't >= 0.1 yet and we are in this phase of fast iterative development, we can safely implement these breaking changes without much concern. We are converging on some foundational implementations and rightly so at the beginning of the project. Essentially, I think it's better to get things done earlier in this phase than deprecate and wait.
from createapi.
I agree with @LePips. It's in a pre-release state. You should be able to freely introduce breaking changes. The initial set of options was added without much consideration for how they all fit together or any long term vision. The main focus was on getting the generation working and covering as many specs as possible.
from createapi.
Thanks @LePips, @kean.. Yeah that makes sense, I think I am being too cautious for our current situation 😄
I'll switch straight to --merge-sources
in that case.. How's that flag sound to you? Even more aggressive maybe, WDYT if I make it a configuration option instead? isMergingSources
or isGroupingSources
?
from createapi.
Related Issues (20)
- Schema component named `Request` generates ambiguous code HOT 4
- `AnyJSON` type included unexpectedly
- Adjust behaviour of `includeDefaultValues` to favour "correctness" by default HOT 1
- integer backed enums are stored as integer properties as opposed to enums HOT 1
- generated package depends on an old version of Get HOT 3
- Tagged type for IDs? HOT 2
- FR: Entity replace substring, instead of naming template HOT 1
- Equatable conformance HOT 1
- Parameters to be passed in headers are ignored during API generation
- Acronyms change property names without changing corresponding CodingKeys
- Deduplicate identical structs/classes
- Add option to separate GET from POST and PATCH requests and only include Decodable respectively Encodable conformance
- Option for treating non-optional enum with only one case as a static value
- `type` definition in OpenAPI spec is overridden by `format` value
- Is there a way to generate `CodingKeys`?
- How to wildcard rules in include and exclude paths
- Use `Swift Syntax`
- Make 'Request' type name configurable HOT 1
- Will OpenAPI schema v3.1.0 be supported?
- Documentation on how to use decoded entity fields HOT 1
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 createapi.