-
Notifications
You must be signed in to change notification settings - Fork 5
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
Comments
On a first look, everything looks good in your input so the reported $ref resolution error looks like a bug. |
It would be great if this could get fixed, we have a really big spec I'd like to break up. Thanks for taking a look. |
There are currently some limitation in the implementation. Deciding between importing (rewriting the document) early or late is tough. The workaround is to use For example (not tested), you could modify openapi: 3.0.3
components:
requests:
helloWorldPayload:
content:
application/json:
schema:
$ref: "spec.yaml#/components/schemas/helloWorldRequestSchema" and openapi: 3.0.3
info:
title: Test spec
description: |-
Test spec
version: 1.0.0
paths:
$inline: paths.yaml#/paths
components:
schemas:
$inline: "schemas.yaml#/components/schemas" I'm not guaranteeing that this exact suggestion will work, however by playing such tricks you should be able to get to a working state. The key is to help Another trick is to create placeholders in the main document where parts of other documents will be injected: create empty |
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:Here are the files that I have, but see my github link to download the code if you need it.
spec.yaml
(root file)paths.yaml
requests.yaml
responses.yaml
schemas.yaml
Is what I'm trying to do possible?
The text was updated successfully, but these errors were encountered: