OpenAPI 3 import error. ENAMETOOLONG
Uncaught (in promise) Error: Error invoking remote method 'renderer:import-collection': Error: ENAMETOOLONG: name too long, open '*********************/Members/Enrolls a member into the ****** Program-
This will create a new member in the system and send an activation link via SMS to the member-
If the member already exists- and GDPR is not accepted yet then a new activation link will be sent-
If the store does not have SMS enabled- the activation link will be sent by email-.bru'
That seems like the method has as a name the whole doc.
Can you share the openapi3? Or at least the relevant part?
https://stackoverflow.com/questions/54741533/nodejs-enametoolong-how-long-is-too-long
I guess the good fix would be to detect this and just trim the names, or generate some random ones.
Here the endpoint were it crashes
"/api/v2.0/stores/{storeId}/members/enroll": {
"post": {
"tags": [
"Members"
],
"summary": "Enrolls a member into the Loyalty Program.\r\nThis will create a new member in the system and send an activation link via SMS to the member.\r\nIf the member already exists, and GDPR is not accepted yet then a new activation link will be sent.\r\nIf the store does not have SMS enabled, the activation link will be sent by email.",
"operationId": "enrollMember",
"parameters": [
{
"name": "storeId",
"in": "path",
"description": "",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/EnrollMemberRequest"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/EnrollMemberRequest"
}
},
"application/*+json": {
"schema": {
"$ref": "#/components/schemas/EnrollMemberRequest"
}
}
}
},
"responses": {
"400": {
"description": "Bad Request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
}
},
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MemberResponse"
}
}
}
}
}
}
},
This part of code needs to be improved to trim the name if it exceeds the max limit for a filename that is allowed on an OS.
@fulvio-diller Is all summary in the open api spec long and detailed descriptions or is it an one-off in the /api/v2.0/stores/{storeId}/members/enroll ?
Same of them are detailed like that.
Why not use the operationId instead of the summary for the filename. Only use the summary if the operationID does not exist.
I am doing a cli converter from Swagger to Bruno in golang and then adding it to GitHub action. I will release it soon
Same here with bruno v1.0.10 / Import of openapi.yaml suddenly stops (extensive summary leads to filenames with more than 500 characters). Option to use operationID as suggested by fulvio-diller would be fine (according to spec operationID MUST be unique within the decribed API, therefore imho a good choice) and maybe summary could be imported as part of the Docs somehow?!
Encountering the same issue on both windows 'renderer:import-collection': Error: ENOENT and on ubuntu, 'renderer:import-collection': Error: ENAMETOOLONG: name too long
Following API spec:
openapi.json
I have some thoughts:
- last n segments in the path instead if we detect length > 120?
- Look for sentence breaks (new line, comma, period, double-space) and use first sentence. Then strip last word if hitting max-length
Relying on the spec might have issues if trying to import something that is not entirely compliant on the spec. So for operationID it can probably happen that it is not unique.
version v1.18.0
Hello,
has there been any update on this?
We also struggle to import some of our openapi definitions into Bruno as the summaries are really long. I believe, it would be cleaner to use the operationId as the fileName or at least provide a dialog to choose this.
Thank you