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.

Question: Should oas-resolver resolve internal $refs?

See original GitHub issue

Resolver issue

  • core functionality
  • CLI options
  • Docs updated
  • New test cases (minimal for now)

I have a .yaml file that contains several internal $ref (and 0 external $ref). I expected that the output from oas-resolver would replace the $ref elements with the content that is targeted by the $ref. However, it seems to skip internal $ref and leave the original element unchanged. Example:

Original file:

....
paths:
  /v1/orders/:
    post:
      ....
      responses:
        '200':
          $ref: '#/components/schemas/Order'
....

Output from speccy resolve myfile.yaml

....
paths:
  /v1/orders/:
    post:
      ....
      responses:
        '200':
          $ref: '#/components/schemas/Order'
....

The Order schema does exist in the same file, and is valid. Is this correct behavior?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
MikeRalphsoncommented, Jan 17, 2019

OK thanks, now I understand your use case. I don’t know when it would be implemented, but I’m not averse to the idea of having an option to do this.

0reactions
MikeRalphsoncommented, Jan 22, 2019

Successfully published:

  • oas-resolver@2.1.0
  • oas-validator@3.1.0
  • reftools@1.0.6
  • swagger2openapi@5.1.0
Read more comments on GitHub >

github_iconTop Results From Across the Web

Should oas-resolver resolve internal $refs? · Issue #142 ...
Yes, oas-resolver is only for resolving external $ref s. Internal $ref s are valid OpenAPI objects in and of themselves, and tools should...
Read more >
Resolve all $refs in JSON Schema - Stack Overflow
I want to resolve all $ref s in my JSON Schema. But internal and external. Which tool provide such functionality? jsonschema.
Read more >
doesnt resolve to any object - Google Groups
When I try add files to a new repository , I get the following error. How can I resolve this ? Thanks. An...
Read more >
Advice for New Referees - US Youth Soccer
Do You Need Questions Answered or Additional Advice? How does a new referee get game assignments? Initial assignments will likely come from a...
Read more >
16 Unwritten Rules Of Officiating - Referee.com
Every official knows the importance of the rules of the game. Regardless of sport, there are some unwritten rules you should follow as...
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