SwaggerUI plugin to show GeoJson responses on a map
- Add
Openlayers
and this plugin to your swaggerui index file
<script src="https://cdn.jsdelivr.net/npm/ol@v10.1.0/dist/ol.js" crossorigin></script>
<script src="https://cdn.jsdelivr.net/npm/@josephinumresearch/swagger-ui-map-plugin/dist/swagger-ui-map-plugin.js" crossorigin></script>
- Register
SwaggerUiMapPlugin()
SwaggerUIBundle({
...
plugins: [
SwaggerUiMapPlugin()
],
...
});
- Execute a request whose response is an
application/geo+json
Run npm install
and then npm run dev
.
For deployment, build the dist/swagger-ui-map-plugin.js
with npm run build
and run npm publish --access public
to publish.