Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty arrays are stripped from request bodies #882

Open
ArielPrevu3D opened this issue May 8, 2024 · 0 comments
Open

Empty arrays are stripped from request bodies #882

ArielPrevu3D opened this issue May 8, 2024 · 0 comments

Comments

@ArielPrevu3D
Copy link

ArielPrevu3D commented May 8, 2024

Empty arrays stripped from my request bodies, even when they are specified as "required" in the schema. Is this the intended behavior?

https://github.com/readmeio/oas/blob/main/packages/oas-to-har/src/index.ts#L442
https://github.com/readmeio/remove-undefined-objects/blob/5.0.0/src/index.ts#L27

My current workaround is the following

import * as ruo from 'remove-undefined-objects';
Object.defineProperty(ruo, 'default', {
  get: () => (obj: unknown) => obj,
});

The API I'm working with needs me to send an empty array, it won't accept a missing field in the body.

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

No branches or pull requests

1 participant