Comments (2)
Can you try this again? We've made some improvements.
from json-schema-to-openapi-schema.
I'm having the same issue on Linux. Lib version 0.4.0.
Here's a JSON Schema I use. It uses some features of newer drafts but online JSON Schema validation tools say it's a valid Draft4-5 schema.
{
"$schema": "https://json-schema.org/draft-04/schema",
"definitions": {
"address": {
"type": "object",
"properties": {
"street_address": {
"type": "string"
},
"city": {
"type": "string"
},
"state": {
"type": "string"
}
},
"required": [
"street_address",
"city",
"state"
]
}
},
"links": [
{
"rel": "self",
"href": ""
},
{
"rel": "about",
"href": "/docs",
"targetSchema": {
"$ref": "/author/schema"
}
}
],
"$id": "hello",
"type": "object",
"required": ["dependenciesProp"],
"properties": {
"dependenciesProp": {
"type": "object",
"properties": {
"a": {
"type": "string"
}
},
"dependencies": {
"one": ["emailFormat"]
}
},
"exclusiveMaximumProp": {
"type": "number",
"maximum": 99,
"minimum": 1,
"exclusiveMaximum": true,
"exclusiveMinimum": true
},
"emailFormat": {
"type": "string",
"format": "email"
},
"hostnameFormat": {
"type": "string",
"format": "hostname"
},
"ipv4Format": {
"type": "string",
"format": "ipv4"
},
"ipv6Format": {
"type": "string",
"format": "ipv6"
},
"uriFormat": {
"type": "string",
"format": "uri"
},
"allOfProp": {
"allOf": [
{
"type": "string"
},
{
"type": "number"
}
]
},
"oneOfProp": {
"oneOf": [
{
"type": "string"
},
{
"type": "number"
}
]
},
"notProp": {
"not": {
"type": "string"
}
},
"itemsArray": {
"type": "array",
"items": [
{
"type": "string"
},
{
"type": "number"
}
]
},
"containsProp": {
"type": "array",
"contains": {
"type": "number"
}
},
"readOnlyProp": {
"type": "number",
"readOnly": true
},
"writeOnlyProp": {
"type": "number",
"writeOnly": true
},
"additionalItemsProp": {
"type": "array",
"additionalItems": false
},
"propertyNamesProp": {
"type": "object",
"propertyNames": {
"pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
}
},
"patternPropertiesProp": {
"type": "object",
"^S_": {
"type": "string"
},
"^I_": {
"type": "integer"
}
},
"mediaProp": {
"type": "string",
"media": "text/html"
}
}
}
from json-schema-to-openapi-schema.
Related Issues (17)
- Is there a possibility of CLI? HOT 1
- issue with up and running HOT 1
- Support for converting patternProperties? HOT 15
- Upgrading to support examples from draft-06 HOT 11
- Does not convert "type: null" correctly in most common use case. HOT 3
- Add licence to project HOT 2
- Golang
- Cannot convert type null with $ref
- Type ["null", "foo"] not converted correctly in "$ref"
- is this backwards compatible with json schema draft 04?
- JSON Schema - Definitions HOT 2
- Relies on an outdated library HOT 1
- Add GitHub releases HOT 1
- types in definitions are not converted HOT 1
- Remove $id from subschemas too
- Document that OpenAPI 2.0 is supported 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 json-schema-to-openapi-schema.