mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-23 08:48:32 +02:00
fix(swagger): update netip.Addr definition type to string
This commit is contained in:
@@ -5261,7 +5261,16 @@
|
|||||||
"x-omitempty": false
|
"x-omitempty": false
|
||||||
},
|
},
|
||||||
"netip.Addr": {
|
"netip.Addr": {
|
||||||
"type": "object",
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"format": "ipv4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"format": "ipv6"
|
||||||
|
}
|
||||||
|
],
|
||||||
"x-nullable": false,
|
"x-nullable": false,
|
||||||
"x-omitempty": false
|
"x-omitempty": false
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -7,6 +7,20 @@ path = "internal/api/v1/docs/swagger.json"
|
|||||||
with open(path, "r") as f:
|
with open(path, "r") as f:
|
||||||
data = json.load(f)
|
data = json.load(f)
|
||||||
|
|
||||||
|
if isinstance(data["definitions"]["netip.Addr"], dict):
|
||||||
|
# MarshalText()
|
||||||
|
data["definitions"]["netip.Addr"] = {
|
||||||
|
"anyOf": [{
|
||||||
|
"type": "string",
|
||||||
|
"format": "ipv4"
|
||||||
|
}, {
|
||||||
|
"type": "string",
|
||||||
|
"format": "ipv6"
|
||||||
|
}],
|
||||||
|
"x-nullable": False,
|
||||||
|
"x-omitempty": False
|
||||||
|
}
|
||||||
|
|
||||||
def set_non_nullable(data):
|
def set_non_nullable(data):
|
||||||
if not isinstance(data, dict):
|
if not isinstance(data, dict):
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user