Coder Social home page Coder Social logo

Comments (2)

philsturgeon avatar philsturgeon commented on September 24, 2024

Can you try this again? We've made some improvements.

from json-schema-to-openapi-schema.

postatum avatar postatum commented on September 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.