Skip to content
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

api: swagger: review (JSON)stream response types #44783

Open
thaJeztah opened this issue Jan 10, 2023 · 1 comment
Open

api: swagger: review (JSON)stream response types #44783

thaJeztah opened this issue Jan 10, 2023 · 1 comment

Comments

@thaJeztah
Copy link
Member

    From the swagger, it looks like we have `BuildInfo`, `CreateImageInfo`, and `PushImageInfo`;
  • None of those are referenced from within the swagger (this may be because those streams are not a good fit for Swagger, but I'd have to check why)
  • It looks like all of them are effectively describing JSONMessage;
    // JSONMessage defines a message struct. It describes
    // the created time, where it from, status, ID of the
    // message. It's used for docker events.
    type JSONMessage struct {
    Stream string `json:"stream,omitempty"`
    Status string `json:"status,omitempty"`
    Progress *JSONProgress `json:"progressDetail,omitempty"`
    ProgressMessage string `json:"progress,omitempty"` // deprecated
    ID string `json:"id,omitempty"`
    From string `json:"from,omitempty"`
    Time int64 `json:"time,omitempty"`
    TimeNano int64 `json:"timeNano,omitempty"`
    Error *JSONError `json:"errorDetail,omitempty"`
    ErrorMessage string `json:"error,omitempty"` // deprecated
    // Aux contains out-of-band data, such as digests for push signing and image id after building.
    Aux *json.RawMessage `json:"aux,omitempty"`
    }

We should have a look at those;

  • If they're all describing JSONMessage, should they all be identical (or same type)?
  • Possibly some endpoints don't use all fields, and due to the use of omitempty they are "different types" (from an API response perspective), although possibly that could be described with -x-nullable
  • None of them describe the ProgressMessage (progress in JSON) and ErrorMessage (error in JSON) fields to be deprecated
  • ProgressMessage appears to be marked as deprecated in 597e0e6 (Refactor stream #2945) - although no mention of the deprecation
  • ErrorMessage was marked deprecated in 3043c26 (Do not require login unless 401 is received on push #1298) - need to check if there's actually still code using the field.

Originally posted by @thaJeztah in #44061 (comment)

@MDK8888
Copy link

MDK8888 commented Feb 4, 2023

Hey, I would love to work on this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants