You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be awesome to have control over what should be sanitized.
Yes, I'm using x-go-<name> extensions for a server codegen, but as a client, it's useful and sometimes necessary to delete some parts of OpenAPI spec.
I think it may be reasonable to have a sanitizer that removes ALL things that are not from the standard OpenAPI spec + an API to control what elements should be sanitized, for example, via an option like:
thanks for the suggestion @zdunecki I will start with something that as you says just removes anything not native to the OAS.
And will look at adding some options for targeting specific extensions, specifying options to remove unused components etc and we can make it extensible for any future suggestions.
Not sure I will get to it this week but will definitely add it shortly
At first glance, it looks fine, but as far as I can see, sanitization works only by excluding something, not including.
If so, for many cases it will be harder to maintain, cuz in my case, for example, I need to sanitize it to the most common format - like supporting only a few extensions. Including will be much easier than excluding
Activity
TristanSpeakEasy commentedon Sep 9, 2025
Hey @zdunecki do you have an example document and a list of the things you would like it to deal with?
When you mention x-go is that an extension you have in your document? That you want removed?
zdunecki commentedon Sep 9, 2025
It would be awesome to have control over what should be sanitized.
Yes, I'm using
x-go-<name>extensions for a server codegen, but as a client, it's useful and sometimes necessary to delete some parts of OpenAPI spec.I think it may be reasonable to have a sanitizer that removes ALL things that are not from the standard OpenAPI spec + an API to control what elements should be sanitized, for example, via an option like:
(rly prof of concept)
TristanSpeakEasy commentedon Sep 9, 2025
thanks for the suggestion @zdunecki I will start with something that as you says just removes anything not native to the OAS.
And will look at adding some options for targeting specific extensions, specifying options to remove unused components etc and we can make it extensible for any future suggestions.
Not sure I will get to it this week but will definitely add it shortly
zdunecki commentedon Sep 9, 2025
@TristanSpeakEasy
Thanks a lot. If you need a contribution, I'm open.
TristanSpeakEasy commentedon Sep 9, 2025
Feel free to have a go at implementing it. We would love contributions. You can use things like:
as examples of the underlying methods we add for the utility methods and their relevant tests
and then see them being implemented as commands:
TristanSpeakEasy commentedon Oct 13, 2025
@zdunecki I had a go at implementing this here #59 please have a look and let me know what you think
TristanSpeakEasy commentedon Oct 14, 2025
This feature has just been released and will be in the next build of the CLI https://github.com/speakeasy-api/openapi/releases/tag/v1.8.0
zdunecki commentedon Oct 14, 2025
@TristanSpeakEasy
Wow, thanks!
At first glance, it looks fine, but as far as I can see, sanitization works only by excluding something, not including.
If so, for many cases it will be harder to maintain, cuz in my case, for example, I need to sanitize it to the most common format - like supporting only a few extensions. Including will be much easier than excluding
Best,