// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`bundle should add to meta ref from redocly registry 1`] = `
fileDependencies: {}
rootType:
  properties:
    openapi: null
    info:
      properties:
        title:
          type: string
        version:
          type: string
        description:
          type: string
        termsOfService:
          type: string
        contact:
          properties:
            name:
              type: string
            url:
              type: string
            email:
              type: string
          extensionsPrefix: x-
          name: Contact
        license:
          properties:
            name:
              type: string
            url:
              type: string
          required:
            - name
          extensionsPrefix: x-
          name: License
        x-logo:
          properties:
            url:
              type: string
            altText:
              type: string
            backgroundColor:
              type: string
            href:
              type: string
          name: Logo
      required:
        - title
        - version
      extensionsPrefix: x-
      name: Info
    servers:
      name: ServerList
      properties: {}
      items:
        properties:
          url:
            type: string
          description:
            type: string
          variables:
            name: ServerVariablesMap
            properties: {}
        required:
          - url
        extensionsPrefix: x-
        name: Server
    security:
      name: SecurityRequirementList
      properties: {}
      items:
        properties: {}
        additionalProperties:
          type: array
          items:
            type: string
        name: SecurityRequirement
    tags:
      name: TagList
      properties: {}
      items:
        properties:
          name:
            type: string
          description:
            type: string
          externalDocs:
            properties:
              description:
                type: string
              url:
                type: string
            required:
              - url
            extensionsPrefix: x-
            name: ExternalDocs
          x-traitTag:
            type: boolean
          x-displayName:
            type: string
        required:
          - name
        extensionsPrefix: x-
        name: Tag
    externalDocs:
      properties:
        description:
          type: string
        url:
          type: string
      required:
        - url
      extensionsPrefix: x-
      name: ExternalDocs
    paths:
      properties: {}
      name: Paths
    components:
      properties:
        parameters:
          name: NamedParameters
          properties: {}
        schemas:
          name: NamedSchemas
          properties: {}
        responses:
          name: NamedResponses
          properties: {}
        examples:
          name: NamedExamples
          properties: {}
        requestBodies:
          name: NamedRequestBodies
          properties: {}
        headers:
          name: NamedHeaders
          properties: {}
        securitySchemes:
          name: NamedSecuritySchemes
          properties: {}
        links:
          name: NamedLinks
          properties: {}
        callbacks:
          name: NamedCallbacks
          properties: {}
      extensionsPrefix: x-
      name: Components
    x-webhooks:
      properties: {}
      name: WebhooksMap
    x-tagGroups:
      name: TagGroups
      properties: {}
      items:
        properties:
          name:
            type: string
          tags:
            type: array
            items:
              type: string
        extensionsPrefix: x-
        name: TagGroup
    x-ignoredHeaderParameters:
      type: array
      items:
        type: string
  required:
    - openapi
    - paths
    - info
  extensionsPrefix: x-
  name: Root
refTypes: {}
visitorsData:
  registry-dependencies:
    links:
      - https://api.redocly.com/registry/params

`;

exports[`bundle should bundle external refs 1`] = `
openapi: 3.0.0
paths:
  /pet:
    parameters:
      - $ref: '#/components/parameters/path-param'
    put:
      parameters:
        - $ref: '#/components/parameters/param-a'
        - $ref: '#/components/parameters/param-b'
        - name: test
    get:
      parameters:
        - $ref: '#/components/parameters/param-a'
        - $ref: '#/components/parameters/param-c'
    post:
      parameters:
        - $ref: '#/paths/~1pet/put/parameters/2'
components:
  parameters:
    param-a:
      name: param_a
      schema:
        $ref: '#/components/schemas/schema-a'
      examples:
        first:
          $ref: '#/components/examples/param-a-first'
        second:
          $ref: '#/components/examples/second'
    path-param:
      name: path_param
      examples:
        first:
          $ref: '#/components/examples/first'
    param-c:
      name: param_c
    param-b:
      name: param_b
  examples:
    first:
      value: b1
    param-a-first:
      value: a1
    second:
      value: a2
  schemas:
    schema-a:
      type: string

`;

exports[`bundle should bundle external refs and warn for conflicting names 1`] = `
openapi: 3.0.0
paths:
  /pet:
    parameters:
      - $ref: '#/components/parameters/path-param'
    put:
      parameters:
        - $ref: '#/components/parameters/param-b'
        - $ref: '#/components/parameters/param-b-2'
    get:
      parameters:
        - $ref: '#/components/parameters/param-a'
        - $ref: '#/components/parameters/param-c'
components:
  parameters:
    param-a:
      name: test
    param-b:
      name: param_b_alt
    path-param:
      name: path_param
    param-c:
      name: param_c
    param-b-2:
      name: param_b

`;

exports[`bundle should bundle schemas with properties named $ref and externalValues correctly 1`] = `
openapi: 3.1.0
info: {}
paths:
  /example:
    get:
      summary: Get Example
      description: This endpoint returns an example response.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  externalValue:
                    type: string
                  $ref:
                    type: string
components: {}

`;

exports[`bundle should dereferenced correctly when used with dereference 1`] = `
openapi: 3.0.0
paths:
  /pet:
    get:
      operationId: get
      parameters:
        - name: shared-a
        - name: get_b
    post:
      operationId: post
      parameters:
        - name: shared-a
components:
  parameters:
    shared_a:
      name: shared-a

`;

exports[`bundle should not bundle url refs if used with keepUrlRefs 1`] = `
openapi: 3.0.0
paths:
  /pet:
    parameters:
      - $ref: '#/components/parameters/path-param'
    put:
      parameters:
        - $ref: https://someexternal.schema
        - $ref: '#/components/parameters/param-b'
        - name: test
    get:
      parameters:
        - $ref: http://someexternal.schema
        - $ref: '#/components/parameters/param-c'
components:
  parameters:
    path-param:
      name: path_param
    param-c:
      name: param_c
    param-b:
      name: param_b

`;

exports[`bundle should not place referenced schema inline when component in question is not of type "schemas" 1`] = `
openapi: 3.0.0
paths:
  /pet:
    post:
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/requestBody'
components:
  schemas:
    requestBody:
      content:
        application/json:
          schema:
            type: object
            properties:
              a:
                type: string
              b:
                type: number

`;

exports[`bundle should place referenced schema inline when referenced schema name resolves to original schema name 1`] = `
openapi: 3.1.0
info:
  title: My API
  description: It ain't so wonderful, but at least it's mine.
  version: '1.0'
  contact:
    email: me@theintenet.com
    name: me
paths:
  /test:
    get:
      summary: test
      responses:
        '200':
          description: test
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/vendor.schema'
components:
  schemas:
    vendor:
      $ref: '#/components/schemas/vendor.schema'
    myvendor:
      $ref: '#/components/schemas/vendor.schema'
    simple:
      type: string
    A:
      type: string
    test:
      $ref: '#/components/schemas/rename-2'
    rename:
      type: string
    rename-2:
      type: number
    vendor.schema:
      title: vendor
      type: object
      description: Vendors
      properties:
        key:
          type: string
          description: System-assigned key for the vendor.
          readOnly: true
        id:
          type: string
          description: >
            Unique identifier of the vendor.

            You must specify a unique vendor ID when creating a vendor unless
            document sequencing is configured, in which case the ID is
            auto-generated.
        name:
          type: string
          description: Name of the vendor.
        isOneTimeUse:
          type: boolean
          description: One-time use
          default: false

`;

exports[`bundle should pull hosted schema 1`] = `
openapi: 3.0.3
info:
  title: bugtest
  version: '1.0'
  description: Demo
  license:
    name: DEMO
    url: https://demo.com
servers:
  - url: http://demo.com/api
paths:
  /customer:
    summary: Customer scope
    get:
      summary: Get demo no refs
      operationId: GetCustomer
      description: Returns Demo No Refs
      responses:
        '200':
          description: Demo No Refs
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Customer'
components:
  schemas:
    Customer:
      type: object
      properties:
        customerName:
          type: string
        accounts:
          type: array
          items:
            $ref: '#/components/schemas/someexternal'
    someexternal: External schema content

`;
