api
api copied to clipboard
Empty arrays are stripped from request bodies
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.