Discussions

Ask a Question
Back to All

Multipart/form-data properties are not generated correctly

I have an endpoint that consumes a multipart/form-data It takes a file and other properties. some of the properties are objects.

Below is how Readme renders the properties

const sdk = require('api')('@fr0sty/v1.0#3y00k1blog8la60');

sdk.uploadKnowledgeDocument({
  newKey: 'New Value',
  appVisibility: 'visible',
  name: 'Product Release Monthly Webinar - May 2023',
  file: 'starbucks%20brand%20voice.pdf'
})
  .then(({ data }) => console.log(data))
  .catch(err => console.error(err));

newKey should be inside an object with a key of metadata and appVisibility should inside an object with key settings

Below is how it should look.

const sdk = require('api')('@fr0sty/v1.0#3y00k1blog8la60');

sdk.uploadKnowledgeDocument({
  metadata: { newKey: 'New Value'},
  settings: {appVisibility: 'visible'},
  name: 'Product Release Monthly Webinar - May 2023',
  file: 'starbucks%20brand%20voice.pdf'
})
  .then(({ data }) => console.log(data))
  .catch(err => console.error(err));

Stoplight & Swagger-UI produce the above result. Why does Readme not include the metadata & settings key in the object?