Closed arctic-alpaca closed 5 months ago
@jwhonce Do you know how I can overwrite the swagger type of a struct field?
Looking at https://github.com/containers/common/blob/main/libnetwork/types/network.go I used swagger:strfmt
to convert the type to a string for ip and mac addresses.
Here https://github.com/containers/common/blob/e720b5cf39f50af623bfb923bba519ae2648705a/libnetwork/types/network.go#L202 I need a string array as type. I have no clue how I can change this. We cannot change the actual go type since they are stable and we cannot break this.
A friendly reminder that this issue had no activity for 30 days.
A friendly reminder that this issue had no activity for 30 days.
@Luap99 @jwhonce Any progress on this?
A friendly reminder that this issue had no activity for 30 days.
A friendly reminder that this issue had no activity for 30 days.
@flouthoc ptal
FYI I asked upstream https://github.com/go-swagger/go-swagger/discussions/2770 but no answer yet.
A friendly reminder that this issue had no activity for 30 days.
A friendly reminder that this issue had no activity for 30 days.
@Luap99 Is this complete now?
Not until we get a new swagger version into podman, see #15550
This should work now.
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
In the API reference for
NetworkConnectLibpod
,static_ips
is listed asArray of Array of integers
but it actually isArray of strings
.static_mac
is listed asArray of integers
but instead isString
. At least those are the types that worked in my testing. Trying something like"static_ips":[[192, 168 100, 10]]
results injson: cannot unmarshal array into Go struct field NetworkConnectOptions.static_ips of type net.IP
Steps to reproduce the issue:
Send request to API
NetworkConnectLibpod
with"static_ips":[[192, 168 100, 10]]
Send request to API
NetworkConnectLibpod
with"static_ips":["192.168.100.10"]
Describe the results you received: 1 results in
json: cannot unmarshal array into Go struct field NetworkConnectOptions.static_ips of type net.IP
Describe the results you expected: 2 results in the expected behavior.
Additional information you deem important (e.g. issue happens only occasionally):
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)
No
Additional environment details (AWS, VirtualBox, physical, etc.): Fedora 35 using rhcontainerbot/podman4 copr.