PaloAltoNetworks / docusaurus-openapi-docs

🦝 OpenAPI plugin for generating API reference docs in Docusaurus v2.
https://docusaurus-openapi.tryingpan.dev
MIT License
561 stars 193 forks source link

API call made on show params #798

Open Pratosh22 opened 1 month ago

Pratosh22 commented 1 month ago

Describe the bug

When show optional parameters is clicked on request form, it makes an API call, which is not expected.

Expected behavior

API call should not be made, it should be made only on pressing the SEND API BUTTON

Current behavior

API call made on clicking show optional params

Possible solution

Set Response action is dispatched, which should ideally not be dispatched in this case

Screenshots

https://github.com/PaloAltoNetworks/docusaurus-openapi-docs/assets/76246084/7031f864-1556-4035-9a14-4f85593fbcc9

Your Environment

sserrata commented 1 month ago

@blindaa121 seems similar to #796, any idea why we're just noticing this issue? Is it reproducible on pan.dev?

blindaa121 commented 1 month ago

@sserrata Hmm.. yeah let me look into this one. Issue is reproducible on pan.dev as well

stakoov commented 1 month ago

Hi @sserrata @blindaa121 the issue here is that this button are in form tag and their default types are type="submit". We need to check and change them to type="button" or remove the form tag :).