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

Create an OpenAPI spec for the data Backend is returning #25

Open
aliok opened this issue Feb 6, 2024 · 7 comments · May be fixed by #73
Open

Create an OpenAPI spec for the data Backend is returning #25

aliok opened this issue Feb 6, 2024 · 7 comments · May be fixed by #73
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@aliok
Copy link
Member

aliok commented Feb 6, 2024

Possible benefits:

  • Generate JS interfaces from the schema (means, one source of truth for the structure of the data being transferred)
  • Backwards compatibility

Tasks:

  • The schema should be defined based on
    type EventMesh struct {
    // EventTypes is a list of all event types in the cluster.
    // While we can embed the event types in the brokers, we keep them separate because
    // not every event type is tied to a broker.
    EventTypes []*EventType `json:"eventTypes"`
    // Brokers is a list of all brokers in the cluster.
    Brokers []*Broker `json:"brokers"`
    }
  • Golang structs should be generated based on that
  • Typescript interfaces should be generated based on that
  • (optional) The schema should be served in the Golang server
  • Docs (like Swagger) should be generated for the Golang server
  • (optional) Define API versions (v1, v2) for different versions of the endpoint

Notes:

  • Execution on code generation should be scripted (Shell script) and the script should be placed under /hack directory)
  • Generated code should be checked in

Extended tasks:

  • CI (GitHub actions) should check if the code generation was run (basically, in a separate action, check out the code, check run the code generation, check if there's any Git diff)
  • (optional) Prow needs to do this check too
@aliok
Copy link
Member Author

aliok commented Feb 6, 2024

@pierDipi what did you have in mind about the backwards compatibility here?

@pierDipi
Copy link
Member

pierDipi commented Feb 6, 2024

Generally as the backend needs to be able to work with multiple frontend versions, having a clear "contract" documented and evolving as we make change will make clear if a given change is both backward and forward compatible

@aliok aliok added good first issue Good for newcomers help wanted Extra attention is needed labels Feb 7, 2024
Copy link

This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Reopen the issue with /reopen. Mark the issue as
fresh by adding the comment /remove-lifecycle stale.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 13, 2024
@aliok
Copy link
Member Author

aliok commented May 22, 2024

/remove-lifecycle stale

@knative-prow knative-prow bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 22, 2024
@ayushrakesh
Copy link

@aliok I want to work on this issue, need some help. How to go forward?

@swastik959 swastik959 linked a pull request Jun 30, 2024 that will close this issue
Copy link

This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Reopen the issue with /reopen. Mark the issue as
fresh by adding the comment /remove-lifecycle stale.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 23, 2024
@aliok
Copy link
Member Author

aliok commented Sep 23, 2024

/remove-lifecycle stale

@knative-prow knative-prow bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants