You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am facing challenges with the readLocation method in swagger-parser. When attempting to load an OpenAPI specification from a remote URL that is not reachable, the method takes around 2 minutes before it throws an exception and reaches the catch block.
This behavior seems to stem from the lack of explicit connection and read timeout configurations within the swagger-parser library.
Use Case
In scenarios where the remote URL is invalid, unreachable, or timing out, I would expect the parser to throw an error immediately or within a reasonable timeout period. However, currently, the method appears to rely on the underlying HTTP client's default timeout settings (which can be quite high, e.g., 120 seconds), causing unnecessary delays in the application flow.
Expected Behavior
Provide a way to configure:
Connection Timeout: Maximum time to establish a connection to the remote server. Read Timeout: Maximum time to wait for a response after the connection is established.
For example, I would like to set these timeouts explicitly when using the readLocation method:
I am facing challenges with the readLocation method in swagger-parser. When attempting to load an OpenAPI specification from a remote URL that is not reachable, the method takes around 2 minutes before it throws an exception and reaches the catch block.
This behavior seems to stem from the lack of explicit connection and read timeout configurations within the swagger-parser library.
Use Case
In scenarios where the remote URL is invalid, unreachable, or timing out, I would expect the parser to throw an error immediately or within a reasonable timeout period. However, currently, the method appears to rely on the underlying HTTP client's default timeout settings (which can be quite high, e.g., 120 seconds), causing unnecessary delays in the application flow.
Expected Behavior
Provide a way to configure:
Connection Timeout: Maximum time to establish a connection to the remote server.
Read Timeout: Maximum time to wait for a response after the connection is established.
For example, I would like to set these timeouts explicitly when using the readLocation method:
SwaggerParseResult parseResult = parser.readLocation( url, null, null, connectionTimeout = 3000, // Connection timeout (in milliseconds) readTimeout = 5000 // Read timeout (in milliseconds) );
Is there best workarounds for this ?
The text was updated successfully, but these errors were encountered: