Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid go code: "-" in struct names #16

Closed
andygrunwald opened this issue Jan 11, 2017 · 1 comment
Closed

Invalid go code: "-" in struct names #16

andygrunwald opened this issue Jan 11, 2017 · 1 comment

Comments

@andygrunwald
Copy link

If you compile this:

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "name": "Repository Configuration",
    "type": "object",
    "additionalProperties": false,
    "required": [ "name" ],
    "properties": {
        "name": {
            "type": "string",
            "description": "Repository name."
        },
        "include-filename": {
            "type": "string",
            "description": "Specify filename instead of default include/all${SHA1_HASH}.json"
        }
    }
}

you will get this as a result:

package main

type Root struct {
  Include-filename string `json:"include-filename,omitempty"`
  Name string `json:"name,omitempty"`
}

As you see the var Include-filename includes a - which leads to invalid go code

a-h added a commit that referenced this issue Jan 12, 2017
@a-h
Copy link
Owner

a-h commented Jan 12, 2017

Thanks for raising the issue!

@a-h a-h closed this as completed Jan 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants