Bug: Issues Generating API Client from Dynamic .json
-Included Paths with openapi2aspida
#254
Open
1 of 3 tasks
.json
-Included Paths with openapi2aspida
#254
Description
When using path names that include
.json
in the OpenAPI definition, attempting to generate an API client withopenapi2aspida
results in a file name pattern matching error. This issue specifically occurs with parameterized paths (e.g.,/category/{id}.json
), not with static paths (for example,/new.json
). Removing.json
from the path resolves the issue, enabling successful API client generationEnvironment
v0.23.2
v20.9.0
10.1.0
Additional context
Specifying a path that includes .json in the OpenAPI definition leads to the following error:
Error: aspida ERROR '_'id}.jso'' does not match '/^_[a-zA-Z][a-zA-Z0-9_]*(@number|@string)?((\.|%[0-9a-fA-F]{2})[a-zA-Z0-9]+)?$/'.
In current Rails applications, it is a common practice to maintain existing routes and use the
.json
extension to distinguish between HTML and JSON responses. This issue is particularly pronounced in API designs that include dynamic .json paths and the inability to generate API clients usingopenapi2aspida
for these paths could significantly impact practical development workflows. Addressing this issue is crucial for maintaining compatibility with existing Rails conventions and supporting a wider range of API design practices.The text was updated successfully, but these errors were encountered: