Skip to content

fix: add default-jre to devcontainer for OpenAPI codegen#1593

Open
jayrmotta wants to merge 4 commits intobitaxeorg:masterfrom
jayrmotta:fix/openapi-missing-java
Open

fix: add default-jre to devcontainer for OpenAPI codegen#1593
jayrmotta wants to merge 4 commits intobitaxeorg:masterfrom
jayrmotta:fix/openapi-missing-java

Conversation

@jayrmotta
Copy link

Summary

Adds default-jre to the devcontainer Dockerfile so OpenAPI code generation can run inside the container.

Problem

OpenAPI code generation requires Java. The firmware build was failing in the Docker devcontainer because the JRE was not installed.

Solution

Install default-jre in the base image dependency list in .devcontainer/Dockerfile.

Testing

  • Build the devcontainer: docker build -t espminer-build .devcontainer
  • Run a full build inside the container: idf.py build
  • Confirm OpenAPI/codegen steps complete and the build succeeds.

OpenAPI code generation requires Java. The firmware build was failing
in the Docker container because the JRE was not installed. Adding
default-jre to the base image dependencies fixes the build.
@mutatrum
Copy link
Collaborator

mutatrum commented Mar 4, 2026

Should also be added to README.md

https://github.com/bitaxeorg/ESP-Miner?tab=readme-ov-file#prerequisites-1

@mutatrum
Copy link
Collaborator

mutatrum commented Mar 4, 2026

Alternatively, change to a non-Java based generator?

@jayrmotta
Copy link
Author

Alternatively, change to a non-Java based generator?

I did some research on OpenAPI's website and all the alternatives also rely on Java. The only option that doesn't rely on Java is the Docker one, which internally also depends on Java, and then our Dockerfile would have to install Docker which would then install Java, not sure if that's better, I feel it's worse.

I also checked the bash launcher, that's just a shell script wrapping the same Java executable.

Some other alternatives like openapi-typescript or orval also generate compatible types, but they don't generate the clients like ApiModule, SystemService, etc, so that would require changing the frontend to use the generated types with wrappers to communicate over the network.

@github-actions
Copy link

github-actions bot commented Mar 5, 2026

Test Results

42 tests  ±0   42 ✅ ±0   0s ⏱️ ±0s
 1 suites ±0    0 💤 ±0 
 1 files   ±0    0 ❌ ±0 

Results for commit 076758e. ± Comparison against base commit 8a31061.

@mutatrum
Copy link
Collaborator

I did some research on OpenAPI's website and all the alternatives also rely on Java. The only option that doesn't rely on Java is the Docker one, which internally also depends on Java, and then our Dockerfile would have to install Docker which would then install Java, not sure if that's better, I feel it's worse.

I also checked the bash launcher, that's just a shell script wrapping the same Java executable.

Some other alternatives like openapi-typescript or orval also generate compatible types, but they don't generate the clients like ApiModule, SystemService, etc, so that would require changing the frontend to use the generated types with wrappers to communicate over the network.

I tried to refactor the project to use ng-openapi-gen, which is a node.js based generator. The generated code is fairly close to what we have now, as far as I can tell. See #1597.

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 this pull request may close these issues.

3 participants