Skip to content

Conversation

@chris48s
Copy link
Collaborator

This PR is a bit of a mixed bag of related things.

  1. There is an infinite render loop on pages that use query params, causing a Maximum Update Depth Exceeded error.

  2. Respect the maxItems property for array query params.

  3. OpenAPI supports number of different styles for array query params via the style and explode properties. This PR adds compatibility for those.

@netlify
Copy link

netlify bot commented Feb 20, 2023

Deploy Preview for docusaurus-openapi ready!

Name Link
🔨 Latest commit 0298434
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-openapi/deploys/6410d2e7d6b0dd000884c529
😎 Deploy Preview https://deploy-preview-241--docusaurus-openapi.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@chris48s
Copy link
Collaborator Author

I've circled back to this and pushed another commit which takes a different approach to fixing the infinite render loop. This gets rid of the loop without introducing any ESLint errors.

Would it be possible to get a review on this?

@chris48s chris48s requested a review from bourdakos1 March 14, 2023 19:18
Comment on lines 246 to 255
{((param?.schema?.maxItems == null ||
items.length < param.schema.maxItems) && (
<button className={styles.buttonThin} onClick={handleAddItem}>
Add item
</button>
)) || (
<button className={styles.buttonThin} disabled>
Add item
</button>
)}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit hard to follow. Can we do something like:

<button 
  className={styles.buttonThin}
  onClick={handleAddItem}
  disabled={param?.schema?.maxItems != null && param.schema.maxItems <= items.length}
>
  Add item
</button>

@bourdakos1 bourdakos1 merged commit 54f2b56 into cloud-annotations:main Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants