INNER CODE UNIT · TypeScript

getRequestOptions

yarax/swagger-to-graphql · src/getRequestOptions.ts:36

export function getRequestOptions({
  method,
  baseUrl,
  path,
  parameterDetails,
  parameterValues,
  formData = false,
}: RequestOptionsInput): RequestOptions {
  const result: RequestOptions = {
    method,
    baseUrl,
    path,
    bodyType: formData ? 'formData' : 'json',
  };

  parameterDetails.forEach(({ name, swaggerName, type, required }) => {
    const value = parameterValues[name];

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…