Comments (8)
looks like more crazy $ref issues. This is one horrible auto-generated spec.
For example:
$ref: "#/paths/~1architectures/get/responses/200/content/application~1xml;%20charset=utf-8/schema
from libopenapi.
Oh wow, I made it work, just needed a couple more tweaks to get the path right. New patch inbound!
from libopenapi.
Will investigate, thanks for finding!
from libopenapi.
Quick question, Has this spec ever worked? Have those references ever been picked up?
The more I look at this, the less sure I am there is a way to resolve it, that path is invalid and it cannot be found using JSONPath. The reason this is panicing (which I can fix) is that the JSON Path being generated from that component reference is currently invalid. This is the type of thing which is causing the panic
$.paths./architectures.get.responses.401.content.application/xml;%20charset=utf-8.['schema']
Should actually be:
$.paths./architectures.get.responses.401.content['application/xml;%20charset=utf-8']['schema']
However this path cannot be found. I've tried it against a few different tools to double check it's not the library that libopenapi
is using under the hood. (https://github.com/vmware-labs/yaml-jsonpath). It's not.
When I load up the spec in my IDE, those references cannot be followed, they can't be looked up there either.
content:
application/xml; charset=utf-8:
example:
code: unknown_architecture
summary: "Architecture does not exist: x999"
schema:
$ref: "#/paths/~1architectures/get/responses/401/content/application~1xml;%20charset=utf-8/schema"
description: Not Found.
This is clearly auto-generated, but it's doing something I don't think I can fix, the path simply isn't reachable, so whilst this spec has valid syntax, it's not actually valid because those paths cannot be looked-up using code (at least, not the way I have been testing)
from libopenapi.
Yeah I just had a quick check with an older version of our tooling and it validates that it is not valid (can't resolve the ref as you say), the issues is definitely just that a panic is thrown in this case where it would be better to receive a usable error
from libopenapi.
I'm going to try a couple of other things to see if I can shoehorn in a lookup, but it's not looking great, I can't trick the library into finding those whacky paths, either way, I will implement some cleaner handling and prevent the panic.
from libopenapi.
This should be resolved in v0.4.4
. Please confirm when convenient.
from libopenapi.
can confirm this is fixed
from libopenapi.
Related Issues (20)
- `Index.GetAllSchemas()` regression in values returned HOT 6
- nullable reference: hard to properly identify it HOT 4
- Example in the doc is not compiling HOT 1
- Panic During Schema Rendering HOT 3
- Circular reference does not return an error HOT 3
- Bug: securitySchemes oauth2 empty scopes is stripped HOT 2
- [bug] remote specs with local references
- [Question] How to keep `components.schemas` when bundling openapi spec from multiple files? HOT 3
- NewDocument doesn't follow references HOT 1
- In-document references in remote documents not resolving correctly HOT 3
- Race Condition in BuildV3Model
- Panic when rendering a nullable example
- Example not compiling due to error: cannot range over docModel.Model.Paths.PathItems HOT 4
- Bundle Recursive Refs without Resolving
- Quickstart tutorial leads to `nil pointer dereference error` HOT 3
- SpecIndex.GetAll* functions inconsistent - make consistent with GetAllSchemas.
- Add support for OpenAPI v4 Moonwalk HOT 1
- Slowly migrate to range over func HOT 7
- SchemaTypeRef field wrong set nil HOT 1
- Add support for Document Hashing HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libopenapi.