How to use the @stoplight/prism-http.serializeWithDeepObjectStyle function in @stoplight/prism-http

To help you get started, we’ve selected a few @stoplight/prism-http examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github stoplightio / prism / packages / cli / src / util / paths.ts View on Github external
E.chain(value => {
      switch (spec.style) {
        case HttpParamStyles.DeepObject:
          return E.right(serializeWithDeepObjectStyle(spec.name, value));

        case HttpParamStyles.PipeDelimited:
          return pipe(
            value,
            E.fromPredicate(
              Array.isArray,
              () => new Error('Pipe delimited style is only applicable to array parameter')
            ),
            E.map(v => serializeWithPipeDelimitedStyle(spec.name, v, spec.explode))
          );

        case HttpParamStyles.SpaceDelimited:
          return pipe(
            value,
            E.fromPredicate(
              Array.isArray,