Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to split requests, responses, schemas into separate files #13

Open
mrmeyers99 opened this issue Feb 9, 2024 · 0 comments
Open

How to split requests, responses, schemas into separate files #13

mrmeyers99 opened this issue Feb 9, 2024 · 0 comments

Comments

@mrmeyers99
Copy link

mrmeyers99 commented Feb 9, 2024

I've been able to merge paths in from multiple files, but we haven't been able to figure out how to split the requests, responses, and schemas into separate schemas. I've created a sample repo that shows what I'm trying to do, and as you can see from the github actions worfklow I get the following error:

/components/requests/helloWorldPayload/content/application~1json/schema: content replaced from /github/workspace/schemas.yaml

Here are the files that I have, but see my github link to download the code if you need it.

spec.yaml (root file)

openapi: 3.0.3
info:
  title: Test spec
  description: |-
    Test spec
  version: 1.0.0

paths:
  $inline: paths.yaml#/paths

paths.yaml

openapi: 3.0.3
info:
  title: Paths
  description: Paths
  version: 1.0.0

paths:
  /helloWorld:
    post:
      description: Say hello
      requestBody:
        $ref: "requests.yaml#/components/requests/helloWorldPayload"
      responses:
        "200":
          $ref: "responses.yaml#/components/responses/helloWorldResponse"

requests.yaml

openapi: 3.0.3
components:
  requests:
    helloWorldPayload:
      content:
        application/json:
          schema:
            $ref: "schemas.yaml#/components/schemas/helloWorldRequestSchema"

responses.yaml

openapi: 3.0.3
components:
  responses:
    helloWorldResponse:
      description: OK
      content:
        application/json:
          schema:
            $ref: 'schemas.yaml#/components/schemas/hellowWorldResponseSchema'

schemas.yaml

openapi: 3.0.1
components:
  schemas:
    helloWorldRequestSchema:
      type: object
      properties:
        name:
          type: string
          description: name

    hellowWorldResponseSchema:
      type: object
      properties:
        message:
          type: string
          description: name

Is what I'm trying to do possible?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant