Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion openapi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli generate -i /local/docs/swagger.yaml --git-user-id blinklabs-io --git-repo-id cardano-node-api -g go -o /local/openapi -c /local/openapi-config.yml
make format golines
cd openapi && go mod tidy
cd openapi && if [[ "$OSTYPE" == "darwin"* ]]; then sed -i '' 's/go 1.23/go 1.24.0/' go.mod; else sed -i 's/go 1.23/go 1.24.0/' go.mod; fi && go mod tidy
2 changes: 1 addition & 1 deletion openapi/.openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.14.0
7.18.0-SNAPSHOT
2 changes: 1 addition & 1 deletion openapi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat

- API version: 1.0
- Package version: 1.0.0
- Generator version: 7.14.0
- Generator version: 7.18.0-SNAPSHOT
Copy link
Copy Markdown

@coderabbitai coderabbitai bot Jan 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🌐 Web query:

latest stable version openapi-generator 2025

💡 Result:

The latest stable release of OpenAPI Generator in 2025 is v7.18.0, released on December 22, 2025. [1], [2]


🏁 Script executed:

# Check if there's a VERSION file or other configuration in the repo
find . -type f -name "VERSION" -o -name "pom.xml" -o -name "build.gradle" -o -name "package.json" | head -20

Repository: blinklabs-io/cardano-node-api

Length of output: 109


🏁 Script executed:

# Check the context around line 10 in openapi/README.md to understand more
cat openapi/README.md | head -30

Repository: blinklabs-io/cardano-node-api

Length of output: 931


🏁 Script executed:

cat ./openapi/.openapi-generator/VERSION

Repository: blinklabs-io/cardano-node-api

Length of output: 88


Upgrade generator version to stable release.

The openapi-generator version should be updated from 7.18.0-SNAPSHOT to 7.18.0 (stable). The stable release has been available since December 22, 2025, and using the production-ready version is recommended over the pre-release build.

🤖 Prompt for AI Agents
In `@openapi/README.md` at line 10, Update the OpenAPI generator version string in
the README by replacing the pre-release token "Generator version:
7.18.0-SNAPSHOT" with the stable release "Generator version: 7.18.0" so the
documentation references the production-ready generator; locate the exact line
containing the "Generator version: 7.18.0-SNAPSHOT" entry and change it to
"Generator version: 7.18.0".

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wolf31o2, understood. I'll leave the generator version as is.


🧠 Learnings used
Learnt from: wolf31o2
Repo: blinklabs-io/cardano-node-api PR: 525
File: openapi/git_push.sh:44-49
Timestamp: 2026-01-25T22:24:06.100Z
Learning: The file `openapi/git_push.sh` in the cardano-node-api repository is auto-generated by the OpenAPI generator and should not be manually modified, as changes would be overwritten on regeneration.

- Build package: org.openapitools.codegen.languages.GoClientCodegen
For more information, please visit [https://blinklabs.io](https://blinklabs.io)

Expand Down
57 changes: 57 additions & 0 deletions openapi/git_push.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/bin/sh
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
#
# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"

git_user_id=$1
git_repo_id=$2
release_note=$3
git_host=$4

if [ "$git_host" = "" ]; then
git_host="github.com"
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
fi

if [ "$git_user_id" = "" ]; then
git_user_id="blinklabs-io"
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
fi

if [ "$git_repo_id" = "" ]; then
git_repo_id="cardano-node-api"
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
fi

if [ "$release_note" = "" ]; then
release_note="Minor update"
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
fi

# Initialize the local directory as a Git repository
git init

# Adds the files in the local repository and stages them for commit.
git add .

# Commits the tracked changes and prepares them to be pushed to a remote repository.
git commit -m "$release_note"

# Sets the new remote
git_remote=$(git remote)
if [ "$git_remote" = "" ]; then # git remote not defined

if [ "$GIT_TOKEN" = "" ]; then
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
else
git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
fi
Comment on lines +44 to +49
Copy link
Copy Markdown

@coderabbitai coderabbitai bot Jan 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Security: Token may leak in git config and process listings.

Embedding the token directly in the remote URL stores it in .git/config in plaintext, and it may appear in process listings or debug output. Consider using Git credential helpers or environment-based authentication instead.

🔒 Safer alternative using credential helper
     if [ "$GIT_TOKEN" = "" ]; then
         echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
         git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
     else
-        git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
+        git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
+        git config credential.helper '!f() { echo "username=${git_user_id}"; echo "password=${GIT_TOKEN}"; }; f'
     fi

Alternatively, if this is a standard OpenAPI generator template that you don't intend to modify, this may be acceptable for CI/CD contexts where the .git directory is ephemeral.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if [ "$GIT_TOKEN" = "" ]; then
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
else
git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
fi
if [ "$GIT_TOKEN" = "" ]; then
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
else
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
git config credential.helper '!f() { echo "username=${git_user_id}"; echo "password=${GIT_TOKEN}"; }; f'
fi
🤖 Prompt for AI Agents
In `@openapi/git_push.sh` around lines 44 - 49, The script currently embeds
GIT_TOKEN into the remote URL (the git remote add origin ... branch that uses
${GIT_TOKEN}), which leaks the token into .git/config and process listings;
change the flow to add the remote without the token (use the branch of the
script that uses ${git_host}/${git_user_id}/${git_repo_id}.git) and authenticate
via a credential helper or an ephemeral method instead—for example, set up a
temporary credential using git credential or use git -c
http.extraheader="AUTHORIZATION: Bearer $GIT_TOKEN" for the push, or configure
GIT_ASKPASS to supply the token—so remove any code that constructs the URL with
${GIT_TOKEN} and replace it with a token-passing approach that does not store
the token in .git/config.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is generated

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wolf31o2, understood! Since this is auto-generated by the OpenAPI generator, it's best to leave it as-is. Modifying generated files would cause your changes to be overwritten on the next regeneration. The security concern would need to be addressed upstream in the OpenAPI generator templates if needed, but for your CI/CD use case with ephemeral environments, this should be acceptable.


✏️ Learnings added
Learnt from: wolf31o2
Repo: blinklabs-io/cardano-node-api PR: 525
File: openapi/git_push.sh:44-49
Timestamp: 2026-01-25T22:24:06.100Z
Learning: The file `openapi/git_push.sh` in the cardano-node-api repository is auto-generated by the OpenAPI generator and should not be manually modified, as changes would be overwritten on regeneration.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


fi

git pull origin master

# Pushes (Forces) the changes in the local repository up to the remote repository
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
git push origin master 2>&1 | grep -v 'To https'
Copy link
Copy Markdown

@coderabbitai coderabbitai bot Jan 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Bug: grep -v inverts the filter, hiding rather than showing the URL.

The comment on line 55 says "Pushes ... the changes" but grep -v 'To https' removes lines containing "To https" from the output rather than showing them. This appears inverted from the intended behavior.

🐛 Proposed fix
-git push origin master 2>&1 | grep -v 'To https'
+git push origin master 2>&1 | grep 'To https'

Or remove the grep entirely if you want to see all output:

-git push origin master 2>&1 | grep -v 'To https'
+git push origin master 2>&1
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
git push origin master 2>&1 | grep -v 'To https'
git push origin master 2>&1 | grep 'To https'
Suggested change
git push origin master 2>&1 | grep -v 'To https'
git push origin master 2>&1
🤖 Prompt for AI Agents
In `@openapi/git_push.sh` at line 57, The push command currently pipes git push
origin master 2>&1 into grep -v 'To https', which removes the "To https" line
(hiding the remote URL) rather than showing it; update the pipeline to either
remove the grep entirely to preserve all output or change to grep 'To https'
(without -v) to explicitly show the URL line (find the git push origin master
command in git_push.sh and adjust the grep usage accordingly).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is generated

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wolf31o2, understood! Since this file is auto-generated by the OpenAPI generator, it shouldn't be manually edited. I'll note this for future reviews and won't flag issues in generated files.


✏️ Learnings added
Learnt from: wolf31o2
Repo: blinklabs-io/cardano-node-api PR: 525
File: openapi/git_push.sh:57-57
Timestamp: 2026-01-25T22:24:16.543Z
Learning: Files in the `openapi/` directory of the cardano-node-api repository are auto-generated by the OpenAPI generator tool and should not be manually edited.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

4 changes: 2 additions & 2 deletions openapi/go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module github.com/blinklabs-io/cardano-node-api/openapi

go 1.18
go 1.24.0

require github.com/stretchr/testify v1.10.0
require github.com/stretchr/testify v1.11.1

require (
github.com/davecgh/go-spew v1.1.1 // indirect
Expand Down
4 changes: 2 additions & 2 deletions openapi/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
Expand Down