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.

OpenAPI 3.0: $ref path string that includes a dot (name.name) doesn't import correctly.

See original GitHub issue

ISSUE When importing an OpenAPI 3.0 .json file, with a $ref that points to a component path, if the path string contains a . (example: "$ref": "#/components/schemas/item.otherItem"), the path isn’t resolved correctly, and shows an error like the following in the field where the $ref was used:

"value": "reference #/components/schemas/item.otherItem not found in the api spec"

Replacing the .s with a _, allows the file to import correctly.

REPRODUCE:

  1. Import the following file (with .s used) openapi3_works_not.json.zip
  2. Open the example response No response was specfied for the request: com.nedap.healthcare.api.benchmark.Benchmark API.client Migration
  3. Check response body, see following:
"benchmarkResults": [
  {
   "value": "reference #/components/schemas/benchmark.BenchmarkResult not found in the api spec"
  },

For comparison, try importing following file (where .s are replaced with _) openapi3_works.json.zip

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
sciamano89commented, Jul 24, 2021

Hi, just noticed that references that include dots cannot be clicked to “go to reference”. A fix would be awesome, thanks!!!

1reaction
abhijitkanecommented, Apr 17, 2019

@rasbreuknedap Thanks for the detailed report, and apologies for the delay here. I’ve opened up a PR for this fix - https://github.com/postmanlabs/openapi-to-postman/pull/54. We can make a release for this module soon, but this will only be updated in the next version of the Postman app. You can use this as a stand-alone module till then.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using $ref - Swagger
OAS 3 This guide is for OpenAPI 3.0. Using $ref. When you document an API, it is common to have some features which...
Read more >
OpenAPI Specification v3.0.3 | Introduction, Definitions, & More
The OpenAPI Specification (OAS) defines a standard, programming language-agnostic interface description for HTTP APIs.
Read more >
OpenApi Generator reference an external POJO in YAML file ...
I'm not very satisfied with this solution so I want to know if there is a way to tell OpenApi Generator to use...
Read more >
Common Mistakes Developers Make In Their RAML Files
As its name suggests, it is an API Modeling language used by plenty of developers to design their APIs from scratch. It offers...
Read more >
Splitting specification file - API Handyman
Writing OpenAPI (Swagger) Specification Tutorial Series ... The list supports paging. parameters: - name: pageSize in: query description: ...
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