Skip to content
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

Netbox 3.7 /api/swagger.json not found #16

Open
Ilyin-Vladimir opened this issue Dec 18, 2024 · 1 comment
Open

Netbox 3.7 /api/swagger.json not found #16

Ilyin-Vladimir opened this issue Dec 18, 2024 · 1 comment

Comments

@Ilyin-Vladimir
Copy link

Hello everyone!
library does not work with netbox 3.7, there is no file /api/swagger.json in this version
there is a schema in yaml format in URL /api/schema/

Traceback (most recent call last):
  File "/home/vagrant/workspace/inventory/src/main.py", line 15, in <module>
    asyncio.run(
  File "/usr/lib/python3.12/asyncio/runners.py", line 194, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/home/vagrant/workspace/inventory/src/services/inventory.py", line 17, in run
    netbox = AIONetbox.from_openapi(
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/vagrant/workspace/inventory/venv/lib/python3.12/site-packages/aionetbox/api.py", line 54, in from_openapi
    spec = NetboxSpec('{}/api/swagger.json'.format(url))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/vagrant/workspace/inventory/venv/lib/python3.12/site-packages/aionetbox/utils.py", line 40, in wrapper
    'instance': cls(*args, **kwargs)
                ^^^^^^^^^^^^^^^^^^^^
  File "/home/vagrant/workspace/inventory/venv/lib/python3.12/site-packages/prance/__init__.py", line 285, in __init__
    BaseParser.__init__(self, url=url, spec_string=spec_string, lazy=lazy, **kwargs)
  File "/home/vagrant/workspace/inventory/venv/lib/python3.12/site-packages/prance/__init__.py", line 118, in __init__
    self.parse()
  File "/home/vagrant/workspace/inventory/venv/lib/python3.12/site-packages/prance/__init__.py", line 135, in parse
    self.specification = fetch_url(self.url, encoding=encoding, strict=strict)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/vagrant/workspace/inventory/venv/lib/python3.12/site-packages/prance/util/url.py", line 240, in fetch_url
    content, content_type = fetch_url_text(url, cache, encoding=encoding)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/vagrant/workspace/inventory/venv/lib/python3.12/site-packages/prance/util/url.py", line 207, in fetch_url_text
    raise ResolutionError(
prance.util.url.ResolutionError: Cannot fetch URL "https://netbox/api/swagger.json": 404 Not Found
@marcoceppi
Copy link
Contributor

Hello. I'm a former maintainer this project is no longer active and the company Vapor, IO is also no longer active. I may try to revive this project if there's interest this weekend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants