-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
Absolute paths are generated? #85
Comments
The wierd thing here is that both All invalid imports have one thing in common, they are enums, generated using |
@AnderssonPeter, this is fixed in #84 |
It's for both queries and suspense, I don't have access to the spec right now but will try to get you an example tomorrow. |
- Update to the latest `@hey-api/openapi-ts` version `0.42.1` - fixes: #83, - Enables work towards #81 - Fixed a bug where types in mutation hooks were imported from a (non-relative) direct file import. - This is the same fix implemented in #61, which was done for query hooks. - Expand the match regex to take account of non-alphabetical file paths - fixes: #85 - Fixed a bug where JSDocs were not being added to generated hooks. - Add more unit testing
@seriouslag the following specification causes the issue: {
"openapi": "3.0.1",
"info": {
"title": "API",
"version": "1.0"
},
"paths": {
"/api/localization/module/{module}/{language}": {
"get": {
"tags": [
"localization"
],
"operationId": "GetTranslationTexts",
"parameters": [
{
"name": "module",
"in": "path",
"required": true,
"style": "simple",
"schema": {
"$ref": "#/components/schemas/Module"
}
},
{
"name": "language",
"in": "path",
"required": true,
"style": "simple",
"schema": {
"$ref": "#/components/schemas/Language"
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/LocalizationText"
}
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ValidationProblemDetails"
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
}
}
}
},
"403": {
"description": "Forbidden",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
}
}
}
},
"404": {
"description": "Not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"Language": {
"enum": [
"Swedish",
"English"
],
"type": "string"
},
"LocalizationText": {
"required": [
"key",
"text"
],
"type": "object",
"properties": {
"key": {
"$ref": "#/components/schemas/TranslationTextKey"
},
"text": {
"type": "string"
}
},
"additionalProperties": false
},
"Module": {
"enum": [
"Global",
"ResearchProjects"
],
"type": "string"
},
"ProblemDetails": {
"type": "object",
"properties": {
"type": {
"type": "string",
"nullable": true
},
"title": {
"type": "string",
"nullable": true
},
"status": {
"type": "integer",
"format": "int32",
"nullable": true
},
"detail": {
"type": "string",
"nullable": true
},
"instance": {
"type": "string",
"nullable": true
}
},
"additionalProperties": { }
},
"TranslationTextKey": {
"enum": [
"Close",
"Menu"
],
"type": "string"
},
"ValidationProblemDetails": {
"required": [
"errors"
],
"type": "object",
"properties": {
"type": {
"type": "string",
"nullable": true
},
"title": {
"type": "string",
"nullable": true
},
"status": {
"type": "integer",
"format": "int32",
"nullable": true
},
"detail": {
"type": "string",
"nullable": true
},
"instance": {
"type": "string",
"nullable": true
},
"errors": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"additionalProperties": { }
}
}
}
} |
This was fixed in 1.2.0 |
@seriouslag I just tested it and it works as expected, thanks for the quick fix!! |
Describe the bug
When i generate my client code, absolute paths are used instead of relative.
Example of output
The text was updated successfully, but these errors were encountered: