Skip to content

should InterceptType be called after options applied? #81

Description

@Rainshaw

jsonschema-go/reflect.go

Lines 229 to 244 in d4b7536

rc := ReflectContext{}
rc.Context = context.Background()
rc.DefinitionsPrefix = "#/definitions/"
rc.PropertyNameTag = "json"
rc.Path = []string{"#"}
rc.typeCycles = make(map[refl.TypeString]bool)
InterceptType(checkSchemaSetup)(&rc)
for _, option := range r.DefaultOptions {
option(&rc)
}
for _, option := range options {
option(&rc)
}

the rc instance does not set InterceptProperty filed, so the L236 just set rc.InterceptProperty = checkSchemaSetup.

When the options applied, the InterceptProperty would be rewrite.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions