Skip to content

Commit

Permalink
fix: generate more then one schema for PatternProperties keyword
Browse files Browse the repository at this point in the history
Signed-off-by: jakezhu9 <[email protected]>
  • Loading branch information
jakezhu9 committed Jan 15, 2024
1 parent 6501d37 commit 1874788
Show file tree
Hide file tree
Showing 5 changed files with 122 additions and 114 deletions.
4 changes: 2 additions & 2 deletions pkg/tools/gen/genkcl_jsonschema.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,9 @@ func convertSchemaFromJsonSchema(ctx *convertContext, s *jsonschema.Schema, name
result.IndexSignature = indexSignature{
Type: typePrimitive(typAny),
}
for _, prop := range *v {
for i, prop := range *v {
val := prop.Schema
propSch := convertSchemaFromJsonSchema(ctx, val, "patternProperties")
propSch := convertSchemaFromJsonSchema(ctx, val, "patternProperties" + strconv.Itoa(i))
if propSch.IsSchema {
ctx.resultMap[propSch.schema.Name] = propSch
}
Expand Down
Loading

0 comments on commit 1874788

Please sign in to comment.