This repository has been archived by the owner on Nov 18, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
encoding/openapi: allow empty string from ReferenceFunc
When users use ReferenceFunc, it may be hard to map certain types, like CUE builtin types, to the custom namespace. Returning "" now allows such references to be expanded in place. In the case of CUE builtin types, the represented type will be that of the underlying type (usually a string). Change-Id: I27b5bd749f2c5339a2e5381376333e77424ee682 Reviewed-on: https://cue-review.googlesource.com/c/cue/+/2760 Reviewed-by: Jason Wang <jasonwzm@google.com> Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
- Loading branch information
Showing
5 changed files
with
92 additions
and
22 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
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,13 @@ | ||
Keep: { | ||
// This comment is included | ||
excludedStruct: ExcludedStruct | ||
excludedInt: ExcludedInt | ||
} | ||
|
||
// ExcludedStruct is not included in the output. | ||
ExcludedStruct: { | ||
A: int | ||
} | ||
|
||
// ExcludedInt is not included in the output. | ||
ExcludedInt: int |
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", | ||
"info": { | ||
"title": "test", | ||
"version": "v1" | ||
}, | ||
"components": { | ||
"schemas": { | ||
"Keep": { | ||
"type": "object", | ||
"required": [ | ||
"excludedStruct", | ||
"excludedInt" | ||
], | ||
"properties": { | ||
"excludedStruct": { | ||
"description": "This comment is included", | ||
"type": "object", | ||
"required": [ | ||
"A" | ||
], | ||
"properties": { | ||
"A": { | ||
"type": "integer" | ||
} | ||
} | ||
}, | ||
"excludedInt": { | ||
"type": "integer" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |