Skip to content
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

[openapi] Schema is not added when a record from other module is used #4802

Closed
abeykoon opened this issue Sep 14, 2023 · 1 comment · Fixed by ballerina-platform/openapi-tools#1557
Assignees
Milestone

Comments

@abeykoon
Copy link

Description:

Consider the following resource function in a service

    resource function post resources/services/[string serviceId]/
            connection\-schemas(http:RequestContext ctx,
            @http:Payload api:ConnectionSchemaInfo[] connectionSchema) returns http:Created
            |http:InternalServerError|http:NotFound|http:BadRequest {

Here

  1. payload is a ConnectionSchemaInfo[]
  2. ConnectionSchemaInfo coming from a different module (api) w.r.t where service.bal is.

When OpenAPI definition is generated, schema related to this payload is not generated. When record definition was moved to same module, it was generated successfully.

Steps to reproduce:

Please see above

Affected Versions:

Ballerina 2201.7.1

OS, DB, other environment details and versions:

Related Issues (optional):
https://github.com/wso2-enterprise/choreo/issues/23781

@TharmiganK
Copy link
Contributor

The above PR will fix the request body generation for the above mentioned scenario.

While fixing this issue, I saw some gap between the allowed payload types in the http module and the generated request body schema. These inconsistencies will be addressed in a separate issue.

@TharmiganK TharmiganK added the Reason/EngineeringMistake The issue occurred due to a mistake made in the past. label Oct 17, 2023
@lnash94 lnash94 closed this as completed Oct 20, 2023
@github-project-automation github-project-automation bot moved this from PR Sent to Done in Ballerina Team Main Board Oct 20, 2023
@TharmiganK TharmiganK added this to the 2201.8.3 milestone Nov 21, 2023
@lnash94 lnash94 moved this to Done in OpenAPI Tool Roadmap Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants