GithubHelp home page GithubHelp logo

openapi2jsonschema's People

Contributors

ballbag22 avatar chrusty avatar imjoshholloway avatar kimpettersen avatar sysradium avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

openapi2jsonschema's Issues

Issue with -go_constants and signed numbers

Having swagger definition like:

  LatLong:
    type: object
    description: "Specifies a geographic..."
    required:
      - latitude
      - longitude
    properties:
      latitude:
        type: number
        format: double
        maximum: 90.0
        minimum: -90.0
      longitude:
        format: double
        type: number
        maximum: 180.0
        minimum: -180.0

I am getting this kind of go constant (please notice - numbers lost their sign information):

const LatLong string = `{
    "$schema": "http://jsonschema.org/draft04/schema#",
    "required": [
        "latitude",
        "longitude"
    ],
    "properties": {
        "latitude": {
            "maximum": 90,
            "minimum": 90,
            "additionalProperties": false,
            "type": "number",
            "format": "double"
        },
        "longitude": {
            "maximum": 180,
            "minimum": 180,
            "additionalProperties": false,
            "type": "number",
            "format": "double"
        }
    },
    "additionalProperties": false,
    "type": "object",
    "description": "Specifies a geographic..."
}`

It seems like all the hyphens are removed here - https://github.com/chrusty/openapi2jsonschema/blob/master/internal/schemaconverter/filewriter/writer.go#L61

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.