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
Inline endpoint descriptions #4145
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
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.
What's our strategy on inline vs external file?
As we're making changes we can improve the descriptions as we added export by tag and also we need to list 401 codes.
@@ -74,7 +73,9 @@ class ExportImportController extends Controller { | |||
200: createResponseSchema('exportResultSchema'), | |||
...getStandardResponses(404), | |||
}, | |||
...endpointDescriptions.admin.export, | |||
description: | |||
"Exports all features listed in the `features` property from the environment specified in the request body. If set to `true`, the `downloadFile` property will let you download a file with the exported data. Otherwise, the export data is returned directly as JSON. Refer to the documentation for more information about [Unleash's export functionality](https://docs.getunleash.io/reference/deploy/environment-import-export#export).", |
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 can also export by tags, not just by features
@@ -74,7 +73,9 @@ class ExportImportController extends Controller { | |||
200: createResponseSchema('exportResultSchema'), | |||
...getStandardResponses(404), |
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.
If you don't provide a key you may probably get 401 - I'd test it in the openapi UI
On inlining vs internal file descriptions: when we first started this, it was suggested that we store them in an external file to keep the code more compact. However, as it grew, we kind of forgot about it and now most of the descriptions live next to the code. Personally I think I prefer this for these reasons:
But I'd love to hear other views or suggestions too. |
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 this is a good change and it clears up some of our inconsistencies; good work! 🏆 And while it's not related to the changes you made, I think @kwasniew is right when it comes to the standard responses. It might be worth doing in a separate PR, though 💁🏼 (And yeah, it just means that we missed this in a previous PR)
Update OpenApi docs