Where can I modify the HTTP API part?

After Custom Deployment, I was able to access the Manager via localhost:9000/manager/. but when accessing Swagger, I get an error like the image below. Besides, I want to customize the API part to suit myself, so where can I find them in IntelliJ?

Hi,

I see you’re using port 9000 so I assume you are running the npm run serve script which uses webpack dev server to run an app in live reload development mode; if you did this from the manager app directory then the only path wepback dev server understands is /manager/ (note trailing slash is required).

If you run the following command (without npm run serve running):

./gradlew clean installDist

Then start your manager in your IDE with the following environment variable:

OR_APP_DOCROOT=manager/build/install/manager/web

You should be able to access swagger via the manager web server at http://localhost:8080/swagger

As for altering the REST API, we wouldn’t advise altering the openremote REST API as you will have to deal with merging updates. The system can be easily extended by adding new REST API endpoints; ideally from outside of the openremote repo following something like our custom-project structure (we don’t currently have up-to-date artifacts published to maven central which could be consumed but this will be coming soon).

1 Like

You’re right! Thank you! I did it by edit Run Configurations like this:

i don’t know what happened but now swagger access failed http://localhost:8080/swagger/, i haven’t edited source yet! Did you ever meet this case? Pls help me, thank you!

Hi,

Looks like there is a problem with the swagger generator after major dependency update; we’ll take a look at it asap.

1 Like

Will be fixed once this PR is merged and CI/CD updates the manager docker image:

1 Like

Thank you for your help! I will wait