-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
当 allOf/oneOf/anyOf 与 properties 同时存在时会生成错误的代码
- Loading branch information
1 parent
59bd217
commit 373276f
Showing
3 changed files
with
17 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@opendoc/sdk": patch | ||
--- | ||
|
||
当 allOf/oneOf/anyOf 与 properties 同时存在时会生成错误的代码 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
{{~#if (h__or jsonSchema.nullable (r__not (h__or (r__equals jsonSchema.type "object") (r__isObject jsonSchema.properties) jsonSchema.additionalProperties))) }} | ||
{{~#if (h__or jsonSchema.nullable jsonSchema.allOf jsonSchema.oneOf jsonSchema.anyOf jsonSchema.$ref jsonSchema.enum jsonSchema.const (r__includes jsonSchema.type (r__Array "string" "number" "boolean" "integer" "array")))}} | ||
{{#if export}}export {{/if}}type {{name}} = {{> t_json_schema_shape jsonSchema}} | ||
{{else}} | ||
{{else if (h__or (r__equals jsonSchema.type "object") (r__isObject jsonSchema.properties) jsonSchema.additionalProperties)}} | ||
{{!-- only pure object --}} | ||
{{#if export}}export {{/if}}interface {{name}} {{> t_json_schema_shape jsonSchema}} | ||
{{else}} | ||
{{#if export}}export {{/if}}type {{name}} = {{> t_json_schema_shape jsonSchema}} | ||
{{/if}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters