question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Import another yaml file

See original GitHub issue

Hello! 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:closed
  • Created 7 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
rochacbrunocommented, Mar 30, 2017

Merged thanks!

1reaction
AminHPcommented, Mar 28, 2017

Please check my pull request. @rochacbruno

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found