devhammed / insomnia-plugin-documenter Goto Github PK
View Code? Open in Web Editor NEWExport Insomnia workspace HTML documentation.
Home Page: https://insomnia.rest/plugins/insomnia-plugin-documenter
License: MIT License
Export Insomnia workspace HTML documentation.
Home Page: https://insomnia.rest/plugins/insomnia-plugin-documenter
License: MIT License
Hello, I am currently facing an issue. I am trying to install insomnia-plugin-documenter. However, I keep getting a yarn error when installing via the UI.
Error: Yarn error warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
at file:///C:/Users/Marcello/AppData/Local/insomnia/app-2020.5.2/resources/app.asar/bundle.js:103518:16
at ChildProcess.exithandler (child_process.js:295:7)
at ChildProcess.emit (events.js:223:5)
at maybeClose (internal/child_process.js:1021:16)
at Socket. (internal/child_process.js:430:11)
at Socket.emit (events.js:223:5)
at Pipe. (net.js:664:12)
When using the Response Tags feature the generated documentation parses the "internal value" of the tag.
I guess it could use the "Live Preview" value instead.
Insomnia 2023.4.0: Failed to install plugin
The CLI tool this plugin is based is supposed to be able to parse and create Example responses if they are in the request description and are wrapped in between and . When I try this the example I put in the description is displayed in the description field in the HTML output and not on the right side as an example response.
Here is a sample of a description field on a response.
Outputs report data to a CSV, PDF, or XLSX file format. The My Reports tab in the user interface contains the ID for the desired report. If a report is not found or permissions are not granted to export data, the message "Report does not exist or is inaccessible" appears.
* Permissions: The authentication account must have General Access - Read and Print/Export permissions to:
* Applicable component
* Applicable records
* Applicable fields in the component (table)
<!-- RESPONSE -->
{
"Id": 2,
"Name": "Anonymous Incident Analysts",
"Description": "",
"BusinessUnit": false,
"SecurityRoles": [],
"Users": [
{
"Id": 6,
"FullName": "Admin, Lockpath"
},
{
"Id": 27,
"FullName": "User, Test"
}
],
"ChildGroups": [],
"ParentGroups": []
}
<!-- ENDRESPONSE -->
Generating the export and deploying it to a server works fine as long as all sources are in the web server's root directory. However, when moving the deployment to a sub directory, a JSON.parse SyntaxError comes up:
The following structure works fine:
❯ tree www
www
├── bundle.css
├── bundle.css.map
├── bundle.js
├── bundle.js.map
├── favicon.ico
├── index.html
├── insomnia.json
└── logo.png
Running a web server with python3 -m http.server 8000
inside the www
directory works fine.
The following structure does not work when the web server root is www
:
❯ tree www
www
├── my-api-docs
│ ├── bundle.css
│ ├── bundle.css.map
│ ├── bundle.js
│ ├── bundle.js.map
│ ├── favicon.ico
│ ├── index.html
│ ├── insomnia.json
│ └── logo.png
Running a web server with python3 -m http.server 8000
inside the www
directory is resulting in a JSON.parse SyntaxError
. Because of this issue, I tested versions 1.0.4
and 1.0.6
of the plugin. The result is the same.
The same issue arises when deploying to a folder on Azure. When I modify the export to have all resources pointing to an absolute path (/my-api-docs/...
), everything is working again. This leads me to believe that relative paths are not being picked up correctly.
Currently the index.html written by the documenter has an external reference for some of the CSS and web fonts used in the page. The prevents the page from rendering correctly on system with no internet access.
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"
integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
I have been able to hack together a workaround doing the following:
/fontawesome
/css
all.css
/webfonts
fa-solid-900.woff2
<link href="/fontawesome/css/all.css" rel="stylesheet" />
Ideally you could make include the web font file and the css file in the plugin along with making edits to the index.html file so that all the needed resources were local.
There is one area for improvement that I, not being a web developer, was not able to figure out. The all.css file in the Font Awesome download is 121KB while there is another file called v4-font-face.css in that download that is only 2KB. The v4-font-face.css works for all but the Example Toggle Icon in the upper right of the page. If you can determine the css code to add then the overall plugin size will only increase by about 126 KB, being the small css plus the 124KB for the web font.
The run.svg image and the URI used in the button are external.
My request is to move the run.svg file to be local to the plugin and update the bundle.js file to that the URI in the button points to;
insomnia://app/import?uri=<protocol><host>/insomnia.json
After upgrading from version 1.0.4 and 1.0.5 I'm getting a JSON.parse SyntaxError when accessing a newly generated documentation. It seems to be related to insomnia.json but all JSON validators I've been using tell me it is valid.
Any clue what could be the problem ? When I get back to 1.0.4 the display of the documentation works fine.
Thanks
Hi, I just started using this plugin when I found it in the Insomnia app. I am interested and want to try it. I started in the local environment first. However, when I wanted to try it, I got an error on my console browser like:
TypeError: Cannot read property 'replace' of null
at Re (formatEnv.js:2)
at Object.e.$$.update (Request.svelte:32)
at ne (index.mjs:1284)
at new ot (Request.svelte:81)
at Array.gt (Rows.svelte:16)
at ft (Rows.svelte:12)
at mt (Rows.svelte:11)
at ne (index.mjs:1287)
at new _t (Rows.svelte:8)
at Array.ht (Rows.svelte:15)
This is for my insomnia.json if you want to see it.
I would like to know if there is a solution to this? I am very interested in this plugin because it really helps my work. Sorry for my bad english. Thank you for responding to this issue. Have a good day!
I have been installed the plugin in insomnia designer, but i didn't find this option to generate the docs
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.