Skip to content

Commit 6f9537b

Browse files
committed
moby-openapi: Add new fixup
Upstream is adding more x-go-type fields that break generation. Signed-off-by: Mark Yen <[email protected]>
1 parent 0d3c0ad commit 6f9537b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

.github/actions/spelling/expect.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ bpffs
8989
breadcrumb
9090
browserhome
9191
brucebean
92-
bsdextrautils
9392
bsdtar
9493
btime
9594
bugtracker
@@ -377,6 +376,7 @@ INSTALLMESSAGE
377376
INSTALLPROPERTY
378377
ioctl
379378
ipaddr
379+
IPAM
380380
iptable
381381
Isf
382382
islabel

scripts/dependencies/moby-openapi.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ export class MobyOpenAPISpec extends GlobalDependency(VersionedDependency) {
4747
if (_.get(contents, 'definitions.Network.properties.Created.x-go-type.import.package') === 'time') {
4848
_.set(contents, 'definitions.Network.properties.Created.x-go-type.hints.noValidation', true);
4949
}
50+
// Having the x-go-type here confuses swagger.
51+
if (_.has(contents, 'definitions.IPAMStatus.properties.Subnets.x-go-type')) {
52+
delete _.get(contents, 'definitions.IPAMStatus.properties.Subnets')['x-go-type'];
53+
}
5054

5155
await fs.promises.writeFile(modifiedPath, yaml.stringify(contents), 'utf-8');
5256

0 commit comments

Comments
 (0)