Comments (6)
I've implemented a similar JSON ref parser in python in this project & code. This may help as a reference example.
from oas-kit.
Seems that the when resolving external references here and here it falls back to resolveInternal()
which in tern calls jptr.jptr(root, pointer)
here.
Cursory search shows jptr implements ~1 parsing properly.
from oas-kit.
In trying to develop a simple test case for this I also found that the components/schemas/<name>
validation is too specific, not allowing /
characters:
e.g.
openapi: 3.0.0
info:
title: Example API
description: Tests ~1 resolving in ref
version: 0.0.1
servers:
- url: 'https://localhost:8080/'
description: Example
paths:
"/":
get:
responses:
'200':
description: Example
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Example~1Respnse'
components:
schemas:
"Example/Response":
required:
- Id
properties:
Id:
type: string
format: uuid
example: "d2014f64-ffdf-487b-8d12-67a20976aca6"
Resulting in:
Gathering...
#/components/schemas/Example/Response
component name invalid
examples/pathrefs.yml
Example API 0.0.1
https://localhost:8080/
Failures:
examples/pathrefs.yml
from oas-kit.
/ is not valid in a component name.
"All the fixed fields declared above are objects that MUST use keys that match the regular expression: ^[a-zA-Z0-9\.\-_]+$
"
Sorry for being terse, on my phone.
from oas-kit.
Re: the first point, did you install v2.7.0 from npm, or update a git clone? If the latter, you may need to npm i
to bring in the latest version of jgexml / jptr.
from oas-kit.
@MikeRalphson you're spot on here. Turns out it's not the pointer but the external resolution. I'll open a separate issue w/ details and a partial solution.
from oas-kit.
Related Issues (20)
- swagger2openapi: timestamp events get converted to YAML timestamps
- swagger2openapi: missed request body contenttype after conversion from swagger v2 to openAPI v3.0.x
- Planned support for OpenAPI 3.1? HOT 6
- @ts-check command in index file make typescript project fail to build
- While upgrading swagger2openapi module with latest version @7.0.8, dependency module node-fetch is not updated to latest version HOT 3
- What does this error mean? > #/paths/~1v1~1action~1amend/post/parameters/3/schema, expected 'string' to be 'number' HOT 1
- Dockerfile vulnerability - `Specify at least 1 USER command in Dockerfile with non-root user as argument` HOT 1
- swagger2openapi报错,Swagger schema parse error! HOT 1
- Field "description" values are usurped by the schema's definition description (used via Redoc) HOT 4
- openAPI validator says header in components is invalid and should contain name when specs say differently. HOT 1
- Swagger 2.0 to 3.0 convertor for SwashBuckle.core (.Net) HOT 1
- TS types for oas-validator HOT 1
- Understanding the opinionated nature of this library HOT 7
- Give an option to mark not required fields as nullable HOT 1
- Allow the same operationId under different tags HOT 5
- Update yaml to v2 HOT 4
- [swagger2openapi][components] Add a prefix to generated components HOT 2
- Error reported when swagger. schemas is empty
- Hosted OpenAPI converter is down [502 Bad Gateway] HOT 1
- Description on properties missing if they have $ref
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 oas-kit.