-
Notifications
You must be signed in to change notification settings - Fork 15
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
Initial Swagger integration #512
Conversation
9d1e24d
to
f5ad760
Compare
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.
Hey @nelsonkopliku ,
The functionality is exactly as expected. Perfect!
As you comment, the need of defining all the fields back again here looks pretty annoying. It looks like something where we easily could make mistakes. And again, as you comment, having some sort of logic which takes the data models from the code to create the spec would be the ideal scenario. I don't know having the DTOs would directly enable this, but it looks something interesting to explore.
From me side, we can merge this as initial iteration, and continue exploring the option to "auto" generate the models in next iterations.
provider_data: TrentoWeb.OpenApi.Schema.Provider.ProviderData, | ||
tags: %Schema{ | ||
title: "Tags", | ||
description: "A list of tags attached to a resource", |
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 guess we can be more specific here A list of tags attached to a host
.
Not big deal anyway
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.
We tag several resources next to hosts: clusters, sap systems, databases.
This same schema could be used for those scenarios.
Does it make sense?
I understand the concern but keep in mind this is done once for API version for documentation. |
968fbfa
to
9cae091
Compare
9cae091
to
0f90223
Compare
0f90223
to
deb9da3
Compare
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 think we are ready to merge
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.
LGTM! sorry forgot to approve as always
This PR is the inception for exposing our APIs version 1.0.0.
This very first iteration aims to:
As of now only the Hosts List API is documented.
Here's how that looks like (nothing new 😄)
vokoscreenNG-2022-05-10_17-49-15.mp4
Help me please with defining what should be exposed and what not.
Here's a quick idea.
Expose
Not sure
No Doc
Extra considerations:
at the moment we're adding schemas only, later we'll add also DTOs on top of readmodels to decouple layers.
We can start by having those DTOs and respective OpenApi schemas next to each other (maybe in the same file) and since we're still not sure how much of a burden it will become to maintain, when and if needed we might want to add some macro magic like
def_openapi_schema
(or any better name) to link indeed DTOs and schemas.Again this is a first iteration, let's see how that evolves. ✌️