#Rapidocus OpenApi Viewer

39 messages · Page 1 of 1 (latest)

gleaming pollen
#

Rapidoc + Directus = Rapidocus

View interactive API documentation from OpenAPI Specification of your Directus and customize the appearance.

Settings

  1. Display mode: view | read | focused*
  2. Show method in navbar: false | as-plain-text | as-colored-text | as-colored-block*
  3. Navbar active item: left-bar* | colored-block

* default value

TODO

  1. Add saving settings.
  2. Add some settings from the documentation: https://rapidocweb.com/api.html
  3. Add saving external OpenAPIs and switching between them.

Installation

  1. Find this module on your Directus Marketplace and install it.
  2. Go to Settings -> Project Settings, in the Modules section, enable module Rapidocus.
  3. Reload the page.
  4. Go to Rapidocus in left menu.

Note

  1. Access to your Directus methods is determined by the current user's access settings.
  2. No need to add an access_token.
  3. Sandbox enabled, doesn't request scopes.

Shoutout

Based on the awesome rapidoc component by @mrin9

Inspired by https://github.com/u12206050/directus-extension-api-viewer-module

SRC: https://github.com/Belanchuk/directus-extension-rapidocus

outer merlin
#

Look like you're missing the link to your extension 🤔

gleaming pollen
outer merlin
#

Riiight we have a marketplace! Nevermind! 😄

gleaming pollen
#

:
Added settings:

  • Allow try
  • Show header
  • Allow spec url load
  • Allow spec file load
  • Show info
  • Allow server selection
  • Allow authentication
  • Persist auth
  • Allow search
  • Allow advanced search
  • Font spacing
  • Font size
#

Available out of the box

gleaming pollen
gleaming pollen
#

New version 1.3.7
Changelog:
Added Spec loading when press enter
Set on mobile view mode by default
Disabled read mode for mobile
Added use_path_in_nav_bar setting
Added saving and deleting urls to OpenApi Spec

gleaming pollen
#

Hint:
If during local development you have a duplicate link to the server, then set the Directus variable to PUBLIC_URL=http://localhost:8055. Correct the link if necessary.

gleaming pollen
#

New version 1.3.9
Fixing errors.

crystal grail
#

How to add access_token to the request? Cos I got the 403 error

gleaming pollen
#

This is work for rapidoc

gleaming pollen
crystal grail
#

Directus requires authentication for /server/specs/oas route, but extension just calls rapidoc.value.loadSpec(url.value)
And directus returnes 403

gleaming pollen
gleaming pollen
gleaming pollen
#

Marketplace is broken, all users install the extension via npm .

gleaming pollen
#

@wicked crystal
I can't understand why our extensions (Rapidoсus and Api Viewer) are incompatible.
Maybe you already understand this and can tell me?

#

When both extensions are activated, neither one works.

wicked crystal
#

They could be using the same underlying dependancy which could result in store clashing/hi-jacking

#

Why would anyone be installing them both though? 😄

gleaming pollen
gleaming pollen
#

The marketplace is up and running, please use it

cosmic crag
gleaming pollen
#

Try this url /api-docs/oas

cosmic crag
#

{
"errors": [
{
"message": "Route /api-docs/oas doesn't exist.",
"extensions": {
"path": "/api-docs/oas",
"code": "ROUTE_NOT_FOUND"
}
}
]
}

#

i set the docsPath is docsPath: "api-docs"

gleaming pollen
#

I don't understand where and how you get the error.
Please send a screenshot of the error.

gleaming pollen
#

@cosmic crag Did everything work out for you?

cosmic crag
#

Thanks for you suggestions, i found the solution when read the document of directus.

#

I was tried follow step by step in repo which i send

#

But it can not help me add my custom endpoint into specs of directus

#

So that all i got

gleaming pollen
#

It seems to me that with the correct api-docs setup, custom endpoints should work on /api-docs/oas, just like directus endpoints work on /server/specs/oas