Skip to content

How do I refer to external securitySchema object ? #1972

Description

@yuji38kwmt

I want to split the following file.

openapi: "3.0.0"info:
version: 1.0.0title: Swagger Petstorelicense:
name: MITservers:
- url: http://petstore.swagger.io/v1paths:
/pets/{petId}:
get:
summary: Get PetoperationId: showPetByIdsecurity:
- Everyone: [] tags:
- animalsparameters:
- name: petIdin: pathrequired: truedescription: The id of the pet to retrieveschema:
type: stringresponses:
'200':
description: Expected response to a valid requestcontent:
application/json:
schema:
$ref: "#/components/schemas/Pet"components:
securitySchemes:
Everyone:
description: everyonetype: "apiKey"name: "Authorization"in: "header"schemas:
Pet:
required:
- id
- nameproperties:
id:
type: integerformat: int64name:
type: stringtag:
type: string

I write components object to external file.

petstore-parent.yaml

openapi: "3.0.0"info:
version: 1.0.0title: Swagger Petstorelicense:
name: MITservers:
- url: http://petstore.swagger.io/v1paths:
/pets/{petId}:
get:
summary: Get PetoperationId: showPetByIdsecurity:
- Everyone: [] tags:
- animalsparameters:
- name: petIdin: pathrequired: truedescription: The id of the pet to retrieveschema:
type: stringresponses:
'200':
description: Expected response to a valid requestcontent:
application/json:
schema:
$ref: "./petstore-child.yaml#/components/schemas/Pet"

petstore-child.yaml

components:
securitySchemes:
Everyone:
description: everyonetype: "apiKey"name: "Authorization"in: "header"schemas:
Pet:
required:
- id
- nameproperties:
id:
type: integerformat: int64name:
type: stringtag:
type: string

But I do not know how I refer to external securitySchema object.

get:
summary: Get PetoperationId: showPetByIdsecurity:
- Everyone: [] 

How do I refer to external securitySchema object ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    re-use: ref-everywhereRequests to support referencing in more / all places

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions