-
Notifications
You must be signed in to change notification settings - Fork 1
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
improve docstring for swagger readability #39
Conversation
I did some domcumentation, the display in swagger has become really nice now, however, the practice of adding descriptions in FastAPI makes the code (especially in main.py quite cluttered and ugly. What do you think about it ? |
Make the source code easier understandable (even if it had much lines) and api doc much better |
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, thanks
backend/maelstro/main.py
Outdated
def get_sources() -> list[dict[str, str]]: | ||
""" | ||
List all the geonetwork source servers registered in the config file | ||
:returns: A list of each server with the name defined in the config file and the API URL | ||
""" | ||
return config.get_gn_sources() | ||
|
||
|
||
@app.get("/destinations") | ||
def get_destinations() -> list[dict[str, str]]: |
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.
Seems missing the return type which was defined in models.
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.
yes, I forgot to insert list[DestinationsResponseElement]
thanks
9872933
to
7113511
Compare
2a59419
to
005d187
Compare
|
||
|
||
class PreviewClone(BaseModel): | ||
geonetwork_resources: list[PreviewGN] |
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.
@arnaud-morvan
as discussed, I changed the fields metadata
and data
to geonetwork_resources
and geoserver_resources
Is this still OK for you on frontend side ?
Improve doc texts displayed in Open API interface