Skip to content

Options with quoted ',' signs are mangled during Parse() #21

@liorokman

Description

@liorokman

Sometimes options can contain the comma character as part of the option payload. The Parse() method currently mangles the output.

I have:

	type t struct {
		Reason string `json:"reason" jsonschema:"required,maxLength=1024,pattern=^[A-Za-z]([A-Za-z0-9_\\,:]*[A-Za-z0-9_])?$,description=A reason\\, hopefully a valid one"`
        }

I expected to get the following options:

   options := []string{
            "maxLength=1024", 
            "pattern=^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$", 
            "description=A reason, hopefully a valid one",
    }

But what I actually got was:

   options := []string{
            "maxLength=1024", 
            "pattern=^[A-Za-z]([A-Za-z0-9_", 
            ":]*[A-Za-z0-9_])?$", 
            "description=A reason",
            " hopefully a valid one",
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions