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

Regression in 485ac9 regarding generated variable names #63

Open
pcj opened this issue May 15, 2019 · 0 comments
Open

Regression in 485ac9 regarding generated variable names #63

pcj opened this issue May 15, 2019 · 0 comments

Comments

@pcj
Copy link

pcj commented May 15, 2019

Commit 485ac91f55d29aa83ba86515ca7a6b2bff940503 generates the following code:

Input:

{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$id": "ssl_certificate.jschema",
    "title": "sslcertificate",
    "type": "object",
    "additionalProperties": false,
    "properties": {
        "code": {
            "type": "string",
            "pattern": "^[a-z0-9]{3,10}$"
        },
        "key-url": {
            "description": "The URL to the certificate key.",
            "type": "string"
        },
        "crt-url": {
            "description": "The URL to the certificate data.",
            "type": "string"
        },
        "cacrt-url": {
            "description": "The URL to the ca certificate data.",
            "type": "string"
        }
    },
    "required": [
        "code",
        "key-url",
        "crt-url"
    ]
}

Output:

func (strct *Sslcertificate) UnmarshalJSON(b []byte) error {
    codeReceived := false
    crt-urlReceived := false
    key-urlReceived := false
    var jsonMap map[string]json.RawMessage
    if err := json.Unmarshal(b, &jsonMap); err != nil {
        return err
    }
    ...

The previous commit f3043e0 does not have this issue.

Maybe a merge issue?

@pcj pcj changed the title Regression in 485ac91f55d29aa83ba86515ca7a6b2bff940503 regarding generated variable names Regression in 485ac9 regarding generated variable names May 15, 2019
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

1 participant