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
For more complex client configurations, see the documentation of _[github.com/go-openapi/runtime/client](https://pkg.go.dev/github.com/go-openapi/runtime/client)_, the library which in turn is used by the client.
76
45
77
-
**Note:** setting the `DEBUG` environment variable will dump all requests to standard error output.
46
+
```
78
47
79
48
### Use the client
80
49
81
50
With the client already instantiated, it is possible to consume any API feature.
82
51
83
-
For example, to list the first 100 active virtual machines:
52
+
For example, to list the first 10 active virtual machines:
See [reference](https://pkg.go.dev/github.com/netbox-community/go-netbox) for more information on all possible usages.
83
+
See [docs](docs) or [reference](https://pkg.go.dev/github.com/netbox-community/go-netbox) for more information on all possible usages.
118
84
119
85
## Development
120
86
121
-
The project comes with a containerized development environment that can be used from any platform. It is only required to have [Git](https://git-scm.com) and [Docker Desktop](https://www.docker.com/products/docker-desktop/) (or, separately, [Docker](https://docs.docker.com/engine/install) and [Docker Compose](https://docs.docker.com/compose/install/)) installed on the machine.
87
+
The project comes with a containerized development environment that may be used from any platform. It is only required to have [Git](https://git-scm.com) and [Docker Desktop](https://www.docker.com/products/docker-desktop/) (or, separately, [Docker](https://docs.docker.com/engine/install) and [Docker Compose](https://docs.docker.com/compose/install/)) installed on the machine.
122
88
123
89
To start the development environment, run the following command.
124
90
@@ -140,12 +106,12 @@ make down
140
106
141
107
### Considerations
142
108
143
-
The library is almost entirely generated from the Netbox [OpenAPI](https://www.openapis.org/) specification using _[go-swagger](https://github.com/go-swagger/go-swagger)_. Therefore, files under directories `netbox/client` and `netbox/models` should not be directly modified, as they will be overwritten in the next regeneration (see next section).
109
+
The library is entirely generated from the Netbox [OpenAPI](https://www.openapis.org/) specification using _[openapi-generator](https://github.com/OpenAPITools/openapi-generator)_. Therefore, files listed [here](.openapi-generator/files) should not be directly modified, as they will be overwritten in the next regeneration (see next section).
144
110
145
-
To fix issues in generated code, there are two options:
111
+
In order to fix a bug in the generated code, the corresponding error in the OpenAPI spec must be fixed. To do so, the following steps may be followed:
146
112
147
-
- Change the OpenAPI spec with pre-generation hooks (see [`scripts/pre-generation`](scripts/pre-generation)).
148
-
- If the above is not possible, change the generated code with post-generation hooks (see [`scripts/post-generation`](scripts/post-generation)).
113
+
1. Optional. Patch the OpenAPI spec in this repo by editing [this script](scripts/fix-spec.py), so that a corrected version can be published as soon as possible.
114
+
2. Fix the OpenAPI spec in the [Netbox repository](https://github.com/netbox-community/netbox), either by reporting an issue or by creating a pull request.
0 commit comments