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 returns a Method too Large error #5157

Closed
TharmiganK opened this issue Sep 2, 2022 · 2 comments
Closed

OpenAPI returns a Method too Large error #5157

TharmiganK opened this issue Sep 2, 2022 · 2 comments

Comments

@TharmiganK
Copy link
Contributor

Description:

Adding @openapi:ServiceInfo{embed: true} annotation to a service fails with Method too Large error

Steps to reproduce:

Run the following sample code :

import ballerina/openapi;
import ballerina/http;

# Represents location
public type Location record {|
   # Name of the location
   string name;
   # Unique identification of the location
   string id;
   # Address of the location
   string address;
|};

# Represents a collection of locations
public type Locations record {|
   # collection of locations
   Location[] locations;
|};

# Represents the unexpected error
public type SnowpeakError record {|
   # Error message
   string msg;
|};

# The response for the unexpected error
public type SnowpeakInternalError record {|
    *http:InternalServerError;
    # The payload for the unexpected error
    SnowpeakError body;
|};

@openapi:ServiceInfo {
   embed: true
}
service /snowpeak on new http:Listener(9090) {

    # Snowpeak locations resource
    # 
    # + return - `Location` or `SnowpeakError` representation
   resource function get locations() returns Locations|SnowpeakInternalError {
       return {body: {msg: "Internal Server Error"}};
   }
}
Compiling source
        sample.bal
ERROR [sample.bal:(36:3217,44:2)] method is too large: '$split$method$2'
error: compilation contains errors

Affected Versions:

Ballerina Swan Lake 2201.1.0

@lnash94
Copy link
Member

lnash94 commented Sep 4, 2022

@lnash94 lnash94 added the Reason/Complex Issue occurred due to complex scenario. label Sep 28, 2022
@lnash94 lnash94 transferred this issue from ballerina-platform/openapi-tools Nov 1, 2023
@TharmiganK
Copy link
Contributor Author

Fixed via ballerina-platform/openapi-tools#1643

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

2 participants