Import another yaml file
See original GitHub issueHello! Thanks for this useful library. I want to import another yaml file in my swagger specification. For example i have a file named username_definitions.yml. Now i want to import bad_request.yml to specify a “bad request” response.
How can i do something like that? If there is no way, will it good idea to implement an import property myself?
username_definitions.yml
This is the summary defined in yaml file
First line is the summary
All following lines until the hyphens is added to description
the format of the first lines until 3 hyphens will be not yaml compliant
but everything below the 3 hyphens should be.
---
tags:
- users
parameters:
- in: path
name: username
type: string
required: true
responses:
200:
description: A single user item
schema:
id: rec_username
properties:
username:
type: string
description: The name of the user
default: 'steve-harris'
import: "bad_request.yml"
bad_request.yml
400:
description: Bad request
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
How can I include a YAML file inside another? - Stack Overflow
No, standard YAML does not include any kind of "import" or "include" statement.
Read more >Including YAML configuration files inside another YAML ...
You can include further files in an included file. Instead of a file name, you can also specify the name of a directory...
Read more >Include a yaml file inside another
Hi, Wondering if there is a way to do the above in SnakeYAML? Potentially similar to what being discussed in the thread below:...
Read more >YAML inherit and include - Magnolia CMS Docs
Use !include to add a reusable chunk. Include a YAML fragment one level below your new definition, or include a complete YAML definition...
Read more >Import files and directories in YAML for a modular design
With yaml-import , the imports are relative to the current YAML file. For further insight on how each import type behaves, you can...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Merged thanks!
Please check my pull request. @rochacbruno