-
Notifications
You must be signed in to change notification settings - Fork 8
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
feat(cat-voices): vit ss endpoints generating #1302
Open
damian-molinski
wants to merge
4
commits into
mve3
Choose a base branch
from
feat/vit_ss_endpoints_generating_1298
base: mve3
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
f69bb1e
feat: vit-ss openapi specs + code generating
damian-molinski 8332d06
chore: bump chopper and chopper_generator
damian-molinski c1d9d3b
refactor: rename from vitss_openapi to vit
damian-molinski 3957d70
fix: exclude openapi from spellchecking
damian-molinski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ckages/internal/catalyst_voices_services/lib/generated/catalyst_gateway/client_index.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export 'cat_gateway_api.swagger.dart' show CatGatewayApi; | ||
export 'vit.swagger.dart' show Vit; |
100 changes: 100 additions & 0 deletions
100
...oices/packages/internal/catalyst_voices_services/lib/src/api_models/overriden_models.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
import 'package:catalyst_voices_services/generated/catalyst_gateway/vit.models.swagger.dart'; | ||
|
||
/// For some reason VitSS openapi spec does not play nice with generating | ||
/// sub classes for Proposal while extending more then 2 level. | ||
/// | ||
/// As temporary solution we're overriding not generated classes because | ||
/// we're remove VitSS integration later. | ||
|
||
// SimpleProposal | ||
|
||
class SimpleProposal$ProposalCategory extends Proposal$ProposalCategory { | ||
SimpleProposal$ProposalCategory({ | ||
super.categoryId, | ||
super.categoryName, | ||
super.categoryDescription, | ||
}); | ||
|
||
factory SimpleProposal$ProposalCategory.fromJson(Map<String, dynamic> json) { | ||
return Proposal$ProposalCategory.fromJson(json)._toSimple(); | ||
} | ||
} | ||
|
||
class SimpleProposal$Proposer extends Proposal$Proposer { | ||
SimpleProposal$Proposer({ | ||
super.proposerName, | ||
super.proposerEmail, | ||
super.proposerUrl, | ||
}); | ||
|
||
factory SimpleProposal$Proposer.fromJson(Map<String, dynamic> json) { | ||
return Proposal$Proposer.fromJson(json)._toSimple(); | ||
} | ||
} | ||
|
||
// CommunityChoiceProposal | ||
|
||
class CommunityChoiceProposal$ProposalCategory | ||
extends Proposal$ProposalCategory { | ||
CommunityChoiceProposal$ProposalCategory({ | ||
super.categoryId, | ||
super.categoryName, | ||
super.categoryDescription, | ||
}); | ||
|
||
factory CommunityChoiceProposal$ProposalCategory.fromJson( | ||
Map<String, dynamic> json, | ||
) { | ||
return Proposal$ProposalCategory.fromJson(json)._toCommunityChoice(); | ||
} | ||
} | ||
|
||
class CommunityChoiceProposal$Proposer extends Proposal$Proposer { | ||
CommunityChoiceProposal$Proposer({ | ||
super.proposerName, | ||
super.proposerEmail, | ||
super.proposerUrl, | ||
}); | ||
|
||
factory CommunityChoiceProposal$Proposer.fromJson(Map<String, dynamic> json) { | ||
return Proposal$Proposer.fromJson(json)._toCommunityChoice(); | ||
} | ||
} | ||
|
||
// Private extension | ||
|
||
extension _Proposal$ProposalCategoryExt on Proposal$ProposalCategory { | ||
SimpleProposal$ProposalCategory _toSimple() { | ||
return SimpleProposal$ProposalCategory( | ||
categoryId: categoryId, | ||
categoryName: categoryName, | ||
categoryDescription: categoryDescription, | ||
); | ||
} | ||
|
||
CommunityChoiceProposal$ProposalCategory _toCommunityChoice() { | ||
return CommunityChoiceProposal$ProposalCategory( | ||
categoryId: categoryId, | ||
categoryName: categoryName, | ||
categoryDescription: categoryDescription, | ||
); | ||
} | ||
} | ||
|
||
extension _Proposal$ProposerExt on Proposal$Proposer { | ||
SimpleProposal$Proposer _toSimple() { | ||
return SimpleProposal$Proposer( | ||
proposerName: proposerName, | ||
proposerEmail: proposerEmail, | ||
proposerUrl: proposerUrl, | ||
); | ||
} | ||
|
||
CommunityChoiceProposal$Proposer _toCommunityChoice() { | ||
return CommunityChoiceProposal$Proposer( | ||
proposerName: proposerName, | ||
proposerEmail: proposerEmail, | ||
proposerUrl: proposerUrl, | ||
); | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
It would be nice if vitss was not under
catalyst)gateway
because its not part of catalyst gateway.Just so the distinction is clearer.
Perhaps in
package:catalyst_voices_services/generated/vitss/*
instead?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.
yeah, wanted to do it too but swagger_dart_code_generator allows only one
input_folder
/output_folder
folder.I was thinking about renaming
catalyst_gateway
toapi
because later generated classes have descriptive names anyways.so from
to
does it make sense?
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.
maybe even rename
cat_gateway_api
to justcat_gateway