Migration to internal API Spec#101
Open
paulwiese wants to merge 9 commits into
Open
Conversation
jschoedl
reviewed
Jun 17, 2026
| openapi-generator-cli generate \ | ||
| -i api/openapi-internal.yaml \ | ||
| -g kotlin \ | ||
| --global-property="apis,models" \ |
Collaborator
There was a problem hiding this comment.
Is there a reason why we'd need those generated docs files? Otherwise I'd drop them
Suggested change
| --global-property="apis,models" \ | |
| --global-property="apis,models,apiDocs=false,modelDocs=false" \ |
jschoedl
requested changes
Jun 17, 2026
| load_dotenv() | ||
|
|
||
| app = FastAPI(title="Cooking Assistant GenAI Service") | ||
|
|
Collaborator
There was a problem hiding this comment.
Suggested change
| @app.exception_handler(HTTPException) | |
| async def http_exception_handler(request: Request, exc: HTTPException): | |
| body = exc.detail if isinstance(exc.detail, dict) else {"message": exc.detail} | |
| return JSONResponse(status_code=exc.status_code, content=body, headers=exc.headers) |
The current code returns {detail: {message: ...}} instead of {message: ...} on error. (same in the recipe service)
Comment on lines
+92
to
+97
| if (!response.isSuccessful) { | ||
| throw ResponseStatusException( | ||
| HttpStatus.BAD_GATEWAY, | ||
| "Upstream service returned error: ${response.code()}", | ||
| ) | ||
| } |
Collaborator
There was a problem hiding this comment.
This returns a 502 BAD GATEWAY for every kind of error with GenAI and discards the error message...
|
|
||
| HelpRequestForwarded: | ||
| type: object | ||
| required: [profile, prompt] |
| -o services/spring-api | ||
|
|
||
| # delete lines causing compilation failures because of missing references | ||
| sed -i '' '/org.openapitools.client.infrastructure/d' services/spring-api/src/main/kotlin/org/openapitools/internal/client/*ServiceApi.kt |
Collaborator
There was a problem hiding this comment.
sed -i '' ...' only works on MacOS, not on "normal" Linux. But do we actually need this line at all?
Collaborator
There was a problem hiding this comment.
This file contains a few schemas at the end that are not used anywhere, I guess they could be removed?
AuthResponse
AuthRequest
UserCredentials
UserProfileUpdate
RecipeUpdate
RecipeCreated
Recipe
RecipeRequest
HelpRequest
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removed forwarded-request schemas from
openapi.yamlSetup
openapi-internal.yamlAdapted
gen-all.shMigrated
spring-api,py-help-service,py-recipe-serviceto new internal specificationDeployed Swagger UI for the public and internal api spec at localhost:8083 via the docker-compose in root