Skip to content

Conversation

eaglethrost
Copy link
Contributor

@eaglethrost eaglethrost commented Sep 10, 2025

🚥 Resolves ISSUE_ID

🧰 Changes

This PR is part of the work for the readme ticket CX-1511 Add support for allowEmptyValue and should get merged ONLY after the changes in the remove-undefined-objects repo because it uses the preserveEmptyArray option which don't exist yet

Focusing in the oas-to-har package:

  • Added hasEmptyArrayDefault function to check if a schema contains any properties that has default empty array
  • Pass in preserveEmptyArray option to removeUndefinedObjects so that empty arrays are not removed

TODO Before Merging:

  • Update the remove-undefined-object package version once the corresponding PR there is shipped

🧬 QA & Testing

  • Create an oas endpoint that has nested array properties in which the default value is an empty array in the request body and is required. Don't pass in any data for the attribute. The HAR output should contain an empty array for the attribute
  • Using the same endpoint, now pass in an empty array data for the attribute. The HAR output should contain an empty array for the attribute

@eaglethrost eaglethrost changed the title feat: add check to preserve empty arrays feat(oas-to-har): add check to preserve empty arrays Sep 10, 2025
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.

1 participant