Closed sekaranglila closed 4 months ago
hi @sekaranglila
The x-internal-field: true
should be put in the $ref
since that is how $ref
behaviour works in OpenAPI.
When it is a reference, the logic follows the reference and treats that content of the reference as expected.
Can you try to put x-internal-field: true
within the $ref for BusinessID
, and see if the parameters gets stripped?
Hi @sekaranglila,
Did you had a chance to try out my suggestion or is this still an open issue?
@thim81 Sorry to hijack the issue, but I was looking to do something similar. The problem with adding the flag inside BusinessID
is that it will be ignored in multiple unrelated endpoints.
Say I have 2 endpoints using the same component with a $ref, how can you filter out that same component out of the first endpoint only keeping the second intact?
hi @TRAD-Anthony-CKO & @sekaranglila
I think I understand what you are trying to achieve. The reference is not needed for some but has to be kept for others.
Is the OpenAPI spec generated? Since you could you manually remove the $ref for the endpoints where it is not wanted.
I'll setup a test to verify the behaviour and see if it possible to add the filtering of $ref.
Thanks for taking a look!
Sadly the OpenAPI spec is not generated, that's why I was looking to filter out a ref block from a single endpoint using the package itself.
I have this definition below:
And after running formatting, it resulted this:
Filter:
"flags": ["x-internal-field"]
As you can see there are 2 field that are left out. I was wondering if anyone knows how to fix it? I've been trying to debug it & reconfiguring my openapi spec file but still no luck