How to use the yasway.create function in yasway

To help you get started, we’ve selected a few yasway 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 Azure / oav / lib / wireFormatGenerator.ts View on Github external
shouldSetAdditionalPropertiesFalse: false,
        shouldResolvePureObjects: false
      }
      this.specResolver = new SpecResolver(
        this.specPath,
        this.specInJson,
        specOptions,
        jsonParser.defaultErrorReport
      )
      await this.specResolver.resolve(suppression)
      await this.resolveExamples(suppression)
      const options = {
        definition: this.specInJson,
        jsonRefs: { relativeBase: this.specDir }
      }
      const api = await Sway.create(options)
      this.swaggerApi = api
      return api
    } catch (err) {
      const e = this.constructErrorObject(ErrorCodes.ResolveSpecError, err.message, [err])
      // self.specValidationResult.resolveSpec = e;
      log.error(`${ErrorCodes.ResolveSpecError.name}: ${err.message}.`)
      log.error(err.stack)
      throw e
    }
  }
github Azure / oav / lib / validators / specValidator.ts View on Github external
const resolver = new specResolver.SpecResolver(
        this.specPath,
        this.specInJson,
        this.options,
        reportError,
        this.docsCache
      )
      this.specInJson = (await resolver.resolve(suppression)).specInJson
      const options = {
        definition: this.specInJson,
        jsonRefs: {
          relativeBase: this.specDir
        },
        isPathCaseSensitive: this.options.isPathCaseSensitive
      }
      this.swaggerApi = await Sway.create(options)
    } catch (err) {
      const e = this.constructErrorObject({
        code: ErrorCodes.InternalError,
        message: err.message,
        innerErrors: [err]
      })
      this.specValidationResult.resolveSpec = e
      log.error(`${ErrorCodes.ResolveSpecError.name}: ${err.message}.`)
      log.error(err.stack)
      throw e
    }
    if (errors.length > 0) {
      const err = errors[0]
      const e = this.constructErrorObject({
        code: ErrorCodes.JsonParsingError,
        message: err.message,

yasway

A library that simplifies Swagger integrations.

MIT
Latest version published 3 years ago

Package Health Score

47 / 100
Full package analysis

Popular yasway functions