-
Notifications
You must be signed in to change notification settings - Fork 520
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
fix: open-api generator script #2661
fix: open-api generator script #2661
Conversation
genSpecCmd="docker run --rm --user $(id -u):$(id -g) -v ${hostSharedDir}:${OPEN_API_MOUNT}" | ||
genSpecCmd="docker run --rm --user 0:0 -v ${hostSharedDir}:${OPEN_API_MOUNT}:z" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous --user
flag was just not working on my system but this may be unique to my setup. If someone wants to give this script a test run to see if this still works for you, that'd be great as an additional data point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was able to run it, but hit three things:
- A pile of errors that I think are expected (below) plus a pile of warnings.
##########################################################################################
#
# Starting openapi code generation with command:
docker run --rm --user 0:0 -v /home/swcur/repos/aries-cloudagent-python/scripts/../open-api/.build:/local:z docker.io/openapitools/openapi-generator-cli:v6.6.0 generate -g openapi --input-spec /local/acapy-raw.json --output /local --config /local/openAPIJSON.config
#
##########################################################################################
[main] WARN o.o.c.config.CodegenConfigurator - There were issues with the specification, but validation has been explicitly disabled.
Errors:
-attribute paths.'/issue-credential/records'(get).[connection_id].example is unexpected
-attribute paths.'/credential/revoked/{credential_id}'(get).[from].example is unexpected
-attribute paths.'/discover-features-2.0/queries'(get).[query_goal_code].example is unexpected
- Unable to delete some files at the end of the process because of permissions issue — presumably because the folder did not exist until the docker process created them with root ownership. I’m guessing we can ignore that for now, but better create the folder ahead with “inherit” settings?
rm: cannot remove '/home/swcur/repos/aries-cloudagent-python/scripts/../open-api/.build/.swagger-codegen/VERSION': Permission denied
rm: cannot remove '/home/swcur/repos/aries-cloudagent-python/scripts/../open-api/.build/.openapi-generator/VERSION': Permission denied
rm: cannot remove '/home/swcur/repos/aries-cloudagent-python/scripts/../open-api/.build/.openapi-generator/FILES': Permission denied
- After I generated, the “connection state” enumeration had the same values, but in different an different order. I assume we can ignore that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the test! I'll look into the permissions thing. The fix you suggest seems like the right way to go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i just ran ./scripts/generate-open-api-spec
and no problems on my box. i don't see the permissions errors @swcurran did, and my end result was the same; updates to the connection state enums.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting... Thanks for the data point!
And some minor cleanup to make the generated openapi more usable Signed-off-by: Daniel Bluhm <[email protected]>
Signed-off-by: Daniel Bluhm <[email protected]>
To mark connection id as required Signed-off-by: Daniel Bluhm <[email protected]>
Instead of UUID Signed-off-by: Daniel Bluhm <[email protected]>
Signed-off-by: Daniel Bluhm <[email protected]>
Signed-off-by: Daniel Bluhm <[email protected]>
Signed-off-by: Daniel Bluhm <[email protected]>
f382e76
to
dd989c3
Compare
@swcurran It looks like we haven't regenerated the openapi in some time, based on how much it changed and the fact that the script was broken lol. I think it would be good to make regeneration a part of the release publishing process, if possible. |
Definitely! Unfortunately, I didn’t know that. Could you update the PUBLISHING.md file with the instructions and I’ll carry it out? Just rough notes are sufficient on the first cut and I’ll embellish them as I run through the process. |
Signed-off-by: Daniel Bluhm <[email protected]>
Pushed the roughest of notes on the process to the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, I had no issues running the command (Mac Ventura 13.6) Docker version 24.0.6.
Reviewed select changes in the generated json file and appears to be a-ok.
Kudos, SonarCloud Quality Gate passed! |
This PR fixes the openapi generator script after recent changes. I also did some minor cleanup to make the generated openapi more usable.