-
Notifications
You must be signed in to change notification settings - Fork 22
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
fix(HMS-1616): OpenAPI cleanup and examples #536
Conversation
type SourceID struct { | ||
SourceId string `json:"source_id"` | ||
} | ||
// See clients.Source | ||
type SourceResponse struct { |
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.
Would we be able to add the provider type here?
We apparently have consumer for that info and it might be helpful even in the UI in the future.
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 would like to either do cleanup in this PR (removal of things) or nothing. I can probably put it back and create a ticket.
But whoever is using that number, it will change between prod/ephemeral and stage likely. It is a not good data source.
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.
Created https://issues.redhat.com/browse/HMS-1829
This is now ready for review and merge, I want to do followup for reservations and I am done!
AwsInfo: &clients.AccountDetailsAWS{AccountID: "78462784632"}, | ||
} | ||
|
||
var SourceUploadInfoAzureResponse = payloads.SourceUploadInfoResponse{ |
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 confused 🤔
This generates example where we have key azureinfo
, but I don't see where the type is defined, but schema defines a key azure
, so there is discrepancy in the key names, but I don't see where it comes from. Are we using the same types for The example response and the schema generating?
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 is defined as follows:
type SourceUploadInfoResponse struct {
Provider string `json:"provider"`
AwsInfo *clients.AccountDetailsAWS `json:"aws" nullable:"true"`
AzureInfo *clients.AccountDetailsAzure `json:"azure" nullable:"true"`
}
Not sure what you mean by discrepancy, JSON can afford more compact names because every key has a context. Go types, however, are globally available. For this reason we have AzureInfo
type, because Azure
would be too broad term.
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.
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 this is a typical error I have seen many times now:
diff --git a/internal/payloads/sources_payload.go b/internal/payloads/sources_payload.go
index cb3dd40..2da271e 100644
--- a/internal/payloads/sources_payload.go
+++ b/internal/payloads/sources_payload.go
@@ -37,9 +37,9 @@ func NewListSourcesResponse(sourceList []*clients.Source) []render.Renderer {
}
type SourceUploadInfoResponse struct {
- Provider string `json:"provider"`
- AwsInfo *clients.AccountDetailsAWS `json:"aws" nullable:"true"`
- AzureInfo *clients.AccountDetailsAzure `json:"azure" nullable:"true"`
+ Provider string `json:"provider" yaml:"provider"`
+ AwsInfo *clients.AccountDetailsAWS `json:"aws" nullable:"true" yaml:"aws"`
+ AzureInfo *clients.AccountDetailsAzure `json:"azure" nullable:"true" yaml:"azure"`
}
This should fix it, pushing.
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.
That helped, thanks! 🚀
Thanks, as you can see no changes were done only examples, documentation and tags were added. |
de92b4d
to
d12cddc
Compare
I noticed a TODO comment in |
let me regenerate the spec for you, it's just the description and we are ready to |
Signed-off-by: Lukas Zapletal <[email protected]>
Thanks! |
Continuation of #500 for all sources endpoints. I am keeping the deprecated endpoints untouched for now, let’s remove them in a separate PR.
I cannot continue working on upload_info until #534 is merged tho, so that is TBD.