Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

etapi.openapi.yaml is not packaged in Desktop builds causing App to crash #1123

Closed
pano9000 opened this issue Feb 5, 2025 · 8 comments · Fixed by #1173
Closed

etapi.openapi.yaml is not packaged in Desktop builds causing App to crash #1123

pano9000 opened this issue Feb 5, 2025 · 8 comments · Fixed by #1173

Comments

@pano9000
Copy link
Contributor

pano9000 commented Feb 5, 2025

Description

Hi,

using the Desktop version on Windows 11 - I just noticed in the ETAPI settings, clicking on the "ETAPI OpenAPI spec" link (which points to http://127.0.0.1:37840/etapi/etapi.openapi.yaml) does not work, but will send you to an error message

Image

TriliumNext Version

0.91.5

What operating system are you using?

Windows

What is your setup?

Local (no sync)

Operating System Version

Windows 11

Error logs

No response

@eliandoran
Copy link
Contributor

I wonder if anyone is using this OpenAPI endpoint. 🤔
And I also wonder if it's up to date with the server.

@pano9000
Copy link
Contributor Author

pano9000 commented Feb 6, 2025

Generally I like seeing openAPI files like these for APIs, as it makes it a lot easier to quickly wrap your head around an API - so I would be all for keeping it. (but maybe I misunderstood your comment above :-D)

Regarding being up-to-date -> that is a good question that we should probably track as a separate task as well.
I'll take a look at it this Sunday

edit 2025-02-07: -> #1131

@perfectra1n
Copy link
Collaborator

Since we have an OpenAPI spec, can't we generate Swagger UI docs for it? I feel like that would be pretty cool to have builtin - like Gitea does.

@eliandoran
Copy link
Contributor

@perfectra1n , yeah, sounds like a nice idea.

@perfectra1n
Copy link
Collaborator

If we like the Swagger UI docs - perhaps that can use that to replace the current URL in the ETAPI OpenAPI spec button in question?

@pano9000
Copy link
Contributor Author

yes, I assume that should be the case – but we should also test with the Desktop Electron version I guess.

@pano9000
Copy link
Contributor Author

pano9000 commented Feb 12, 2025

just tried to build the latest git with electron-forge and now the missing etapi.openapi.yaml file is causing the app to not even start (since swagger endpoint now requires that file to be existing):

A JavaScript error occurred in the main process
Uncaught Exception:
Error: ENOENT, dist/src/etapi/etapi.openapi.yaml not found in /my/path/TriliumNextNotes/out/TriliumNext Notes-linux-x64/resources/app.asar

In other words – we still need to fix the build/packaging process here. :-)

I'll take a look this evening (if no one else will have fixed it before that :-))!

@pano9000 pano9000 changed the title Clicking on the "ETAPI OpenAPI spec" link does not work in Desktop version etapi.openapi.yaml is not packaged in Desktop builds Feb 12, 2025
@pano9000 pano9000 changed the title etapi.openapi.yaml is not packaged in Desktop builds etapi.openapi.yaml is not packaged in Desktop builds causing App to crash Feb 12, 2025
@pano9000
Copy link
Contributor Author

will provide a commit in a couple of moments, that will fix the missing file being copied to the dist folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants