15
Views
3
Comments
[API Doco] Create new API Doco bug
api-doco
Web icon
Forge asset by David Epps
Application Type
Traditional Web

There appears to be a bug when trying to create a new API. I had to change the conditional in the Preparation in order to get the page to load.

GetApiById.List.Empty and ApiId <> NullIdentifier()

Also, the "default template" appears to not work. I got it working using the latest from SwaggerUI:

<html lang="en"> <head> <meta charset="UTF-8"> <title>Swagger UI</title> <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/3.39.0/swagger-ui.css" > <link rel="icon" type="image/png" href="https://app.swaggerhub.com/img/favicon-32x32.png?v=2" sizes="32x32" /> <link rel="icon" type="image/png" href="https://app.swaggerhub.com/img/favicon-16x16.png?v=2" sizes="16x16" /> <style> html { box-sizing: border-box; overflow: -moz-scrollbars-vertical; overflow-y: scroll; } *, *:before, *:after { box-sizing: inherit; } body { margin:0; background: #fafafa; } </style> </head> <body> <div id="swagger-ui"></div> <script src="https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/3.39.0/swagger-ui-bundle.js" charset="UTF-8"> </script> <script src="https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/3.39.0/swagger-ui-standalone-preset.js" charset="UTF-8"> </script> <script> window.onload = function() { // Begin Swagger UI call region const ui = SwaggerUIBundle({ url: "%SPEC%", dom_id: '#swagger-ui', deepLinking: true, presets: [ SwaggerUIBundle.presets.apis, SwaggerUIStandalonePreset ], plugins: [ SwaggerUIBundle.plugins.DownloadUrl ], layout: "StandaloneLayout" }) // End Swagger UI call region window.ui = ui } </script> </body> </html>


``

2018-03-26 20-39-26
David Epps

Hi Erik,

I've uploaded an updated version with the 'New API' issue resolved and also with an updated template that uses swagger files from CDN source.

Thanks,

David

UserImage.jpg
Erik Sunderland

Hi David,

Took me a while to get around to this. It looks like I can create New APIs now, but it doesnt look like the default swagger template was updated.  Just FYI.

I'll continue to use the HTML I posted since the template can user-defined.

UserImage.jpg
Erik Sunderland

Also, I had to increase the DocElement.Value length to 20000 characters. (We have a lot of documentation we want to add) :)

Maybe that field should just be BinaryData, serialized json?

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.