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
This is the Julia library needed with code generated by the [OpenAPI generator](https://openapi-generator.tech/).
6
+
This is the Julia library needed along with code generated by the [OpenAPI generator](https://openapi-generator.tech/) to help define, produce and consume OpenAPI interfaces.
7
7
8
8
The goal of OpenAPI is to define a standard, language-agnostic interface to REST APIs which allows both humans and computers to discover and understand the capabilities of the service without access to source code, documentation, or through network traffic inspection. When properly defined via OpenAPI, a consumer can understand and interact with the remote service with a minimal amount of implementation logic. Similar to what interfaces have done for lower-level programming, OpenAPI removes the guesswork in calling the service.
9
9
10
10
Check out [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) for additional information about the OpenAPI project, including additional libraries with support for other languages and more.
11
11
12
12
> Note: This package supersedes the [Swagger.jl](https://github.com/JuliaComputing/Swagger.jl) package. OpenAPI.jl and the associated generator can address both OpenAPI 2.x (Swagger) and OpenAPI 3.x specifications. Code dependent on Swagger.jl would not directly work with OpenAPI.jl, but migration should not be too difficult.
[Swagger UI](https://swagger.io/tools/swagger-ui/) allows visualization and interaction with the API’s resources without having any of the implementation logic in place. OpenAPI.jl includes convenience methods to launch Swagger UI from Julia.
214
232
215
233
Use `OpenAPI.swagger_ui` to open Swagger UI. It uses the standard `swaggerapi/swagger-ui` docker image and requires docker engine to be installed.
216
234
217
235
```julia
236
+
# specify a specification file to start with
218
237
OpenAPI.swagger_ui(
219
-
spec::String; # the OpenAPI specification to use
238
+
spec::AbstractString;# the OpenAPI specification to use
220
239
port::Int=8080, # port to use
221
240
use_sudo::Bool=false# whether to use sudo while invoking docker
222
241
)
242
+
243
+
# specify a folder and specification file name to start with
244
+
OpenAPI.swagger_ui(
245
+
spec_dir::AbstractString; # folder containing the specification file
246
+
spec_file::AbstractString; # the specification file
247
+
port::Int=8080, # port to use
248
+
use_sudo::Bool=false# whether to use sudo while invoking docker
249
+
)
250
+
```
251
+
252
+
It returns the URL that should be opened in a browser to access the Swagger UI. Combining it with a tool like [DefaultApplication.jl](https://github.com/tpapp/DefaultApplication.jl) can help open a browser tab directly from Julia.
To stop the Swagger UI container, use `OpenAPI.stop_swagger_ui`.
@@ -230,6 +263,49 @@ OpenAPI.stop_swagger_ui(;
230
263
)
231
264
```
232
265
266
+
### Swagger Editor
267
+
268
+
[Swagger Editor](https://swagger.io/tools/swagger-editor/) allows editing of OpenAPI specifications and simultaneous visualization and interaction with the API’s resources without having any of the client implementation logic in place. OpenAPI.jl includes convenience methods to launch Swagger Editor from Julia.
269
+
270
+
Use `OpenAPI.swagger_editor` to open Swagger Editor. It uses the standard `swaggerapi/swagger-editor` docker image and requires docker engine to be installed.
271
+
272
+
```julia
273
+
# specify a specification file to start with
274
+
OpenAPI.swagger_editor(
275
+
spec::AbstractString; # the OpenAPI specification to use
276
+
port::Int=8080, # port to use
277
+
use_sudo::Bool=false# whether to use sudo while invoking docker
278
+
)
279
+
280
+
# specify a folder and specification file name to start with
281
+
OpenAPI.swagger_editor(
282
+
spec_dir::AbstractString; # folder containing the specification file
283
+
spec_file::AbstractString; # the specification file
284
+
port::Int=8080, # port to use
285
+
use_sudo::Bool=false# whether to use sudo while invoking docker
286
+
)
287
+
288
+
# start without specifying any initial specification file
289
+
OpenAPI.swagger_editor(
290
+
port::Int=8080, # port to use
291
+
use_sudo::Bool=false# whether to use sudo while invoking docker
292
+
)
293
+
```
294
+
295
+
It returns the URL that should be opened in a browser to access the Swagger UI. Combining it with a tool like [DefaultApplication.jl](https://github.com/tpapp/DefaultApplication.jl) can help open a browser tab directly from Julia.
0 commit comments