This repository has been archived by the owner on Nov 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
encoding/openapi: add option to close over imported types
To suppor this, two options are included: SelfContained: to enable the feature. NameFunc to allow user-defined fully qualified names to disambiguate imported types. Issue #56 Change-Id: I372f35c5fd71d204a60c8c26d4efce21f9457a27 Reviewed-on: https://cue-review.googlesource.com/c/cue/+/2375 Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
- Loading branch information
Showing
4 changed files
with
131 additions
and
15 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
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
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,7 @@ | ||
MyStruct: { | ||
mediumNum: int32 | ||
smallNum: int8 | ||
|
||
float: float32 | ||
double: float64 | ||
} |
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,35 @@ | ||
{ | ||
"openapi": "3.0.0", | ||
"components": { | ||
"schema": { | ||
"MyStruct": { | ||
"type": "object", | ||
"required": [ | ||
"mediumNum", | ||
"smallNum", | ||
"float", | ||
"double" | ||
], | ||
"properties": { | ||
"double": { | ||
"type": "number", | ||
"format": "double" | ||
}, | ||
"float": { | ||
"type": "number", | ||
"format": "float" | ||
}, | ||
"mediumNum": { | ||
"type": "integer", | ||
"format": "int32" | ||
}, | ||
"smallNum": { | ||
"type": "integer", | ||
"minimum": -128, | ||
"maximum": 127 | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |