Skip to content

BGP Session API POST errors after ASNSerializer change on BGPSessionSerializer #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
omri-ice opened this issue May 10, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@omri-ice
Copy link
Contributor

NetBox version
v2.11.3

Describe the bug
Cannot create a new BGP Session instance via API

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://<netbox-instance>/api/docs/
  2. POST a new BGP session, examples:

Request 1

{
  "local_as": 4,
  "remote_as": 4,
  "name": "New BGP Session",
  "status": "active",
  "site": 4,
  "device": 482,
  "local_address": 13608,
  "remote_address": 13607
}

Response 1

{
  "local_as": {
    "non_field_errors": [
      "Invalid data. Expected a dictionary, but got int."
    ]
  },
  "remote_as": {
    "non_field_errors": [
      "Invalid data. Expected a dictionary, but got int."
    ]
  }
}

Request 2

{
  "local_as": {"id": 4},
  "remote_as": {"id": 4},
  "name": "New BGP Session",
  "status": "active",
  "site": 4,
  "device": 482,
  "local_address": 13608,
  "remote_address": 13607
}

Response 2

{
  "error": "Cannot assign \"OrderedDict()\": \"BGPSession.local_as\" must be a \"ASN\" instance.",
  "exception": "ValueError",
  "netbox_version": "2.11.3",
  "python_version": "3.8.10"
}

Expected behavior
A new BGP Session should have been created

@omri-ice omri-ice added the bug Something isn't working label May 10, 2021
@k01ek k01ek mentioned this issue May 28, 2021
@k01ek k01ek closed this as completed Jun 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants