Extension Openapiviewer


Extension Basics

Title
Openapiviewer
Name
ckanext-openapiviewer
Type
Public extension
Description
BC Data Catalogue extension for OpenAPI (AKA Swagger) console
CKAN versions
Download-Url (zip)
Last commit
4 years ago (2021-11-01 21:06:32)
Url to repo
Category
Authentication & Security


Background Infos

Description (long)
Show details

Lifecycle:Retired

ckanext-openapi

This CKAN Extension creates an OpenAPI (aka Swagger) view that is accessible for previewing OpenAPI JSON resources.

  1. Pre-Installation

1.1 Create a new resource format in CKAN called ‘openapi-json’ using these instructions:

1.1.1. Get the id for resource_format:

GET /api/action/vocabulary_show?id=resource_format

The request should return a json object with id in result, you'll need the value associated with the id key.

1.1.2. Create a POST for tag_create:

POST /api/action/tag_create
Content-Type: application/json
Authorization: <user api key>

{
    "vocabulary_id": "<id value from the first step>",
    "name": "openapi-json"
}

If all goes well, the request should return something like this:

{
    "help": "http://10.1.0.2:5000/packages?ver=%2F1&name=tag_create&logic_function=help_show", 
    "success": true, 
    "result": {
        "vocabulary_id": "a42b7f16-b269-46c1-9464-98edc903fa81", 
        "packages": [], 
        "display_name": "openapi-json", 
        "id": "a3d45295-4fe8-4b64-8de0-d1e43e45a6e2", 
        "name": "openapi-json"
    }
}

Note: the openapi_view plugin is only be visible to resources with format of ‘openapi-json’

  1. Installation

2.1 Copy ckanext-openapi into the ckan src folder

2.2. Within src/ckanext-openapi run:

python setup.py develop

2.3. Add ‘openapi_view’ to the list of plugins in your .ini file.

Note: If this extension is installed alongside ckanext-bcgov, be sure to list the ‘openapi_view’ plugin before the various ‘edc’ plugins in the .ini file.

If this extension is installed alongside pdf_view, be sure to list the ‘openapi_view’ plugin before pdf_view.

2.4. Add the new resource view to the CKAN database:

p

Version
3.1.2
Version release date
2018-03-20
Contact name
(not set)
Contakt email
(not set)
Contact Url
(not set)


Installation Guide

Configuration hints
Plugins to configure (ckan.ini)
openapiviewer
CKAN Settings (ckan.ini)
DB migration to be executed
(not set)
<< back to Extensions