You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When calling a POST or PATCH on the /api/v2/vpn/openvpn/client endpoint, fields which are optional through the PFSense Web UI are required through the API such as local_port or proxy_addr.
To Reproduce
Steps to reproduce the behavior:
Create an OpenVPN client manually in the UI leaving optional fields blank as specified.
Execute a GET command against the /api/v2/vpn/openvpn/client address - the returned json has the following:
Expected behavior
The OpenVPN Client config is updated with the correct values visable inside the Web UI.
Screenshots or Response
The response: '{"code":400,"status":"bad request","response_id":"FIELD_EMPTY_NOT_ALLOWED","message":"Field local_port cannot be empty.","data":[]}\n'
The same result happends with a POST command.
I have also tried setting "0" as the value in local_port but this also fails saying a valid TCP or UDP port number must be provided.
Field in the Web UI:
pfSense Version & Package Version:
pfSense Version: pfSense 2.7.2
Package Version v2.3.0
Affected Endpoints:
/api/v2/vpn/openvpn/client
The text was updated successfully, but these errors were encountered:
This occurs because the API does not treat null and empty values as the same like pfSense does. You'll need to use null for these fields to exclude them instead of empty strings. Explicit null values are often required for the API's conditional field components and internal queries to work correctly.
Describe the bug
When calling a POST or PATCH on the
/api/v2/vpn/openvpn/client
endpoint, fields which are optional through the PFSense Web UI are required through the API such aslocal_port
orproxy_addr
.To Reproduce
Steps to reproduce the behavior:
/api/v2/vpn/openvpn/client
address - the returned json has the following:data
object from the JSON response - in my case changingserver_addr
data
reponse, eg:Expected behavior
The OpenVPN Client config is updated with the correct values visable inside the Web UI.
Screenshots or Response
The response:
'{"code":400,"status":"bad request","response_id":"FIELD_EMPTY_NOT_ALLOWED","message":"Field
local_portcannot be empty.","data":[]}\n'
The same result happends with a POST command.
I have also tried setting "0" as the value in local_port but this also fails saying a valid TCP or UDP port number must be provided.
Field in the Web UI:
pfSense Version & Package Version:
Affected Endpoints:
The text was updated successfully, but these errors were encountered: