Closed Tlahey closed 2 years ago
Hello too, I try to use your tools, which seems very interesting, on my API, but I have the same behavior on my api sample.
openapi: 3.0.3
info:
title: Annotations test API
version: 1.0.1
components:
schemas:
Annotations:
title: Annotations
type: object
additionalProperties: true
example:
key: value
key2:
- value1
- value2
paths:
/api/v1/{target}/annotations:
put:
operationId: Annotations.put
description: Replace Annotations
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/Annotations"
parameters:
- in: path
name: target
required: true
schema:
type: string
pattern: ^[a-z0-9][a-z0-9-]*$
minLength: 1
maxLength: 32
example: my-target
responses:
"200":
description: Annotations response
content:
application/json:
schema:
$ref: "#/components/schemas/Annotations"
Generated Components
ans Paths
are well generated but not referenced in OperationMethods
or PathsDictionary
Actual generated OperationMethods
:
export interface OperationMethods {
/**
* Annotations.put - Replace Annotations
*/
'Annotations.put'(
parameters?: Parameters<UnknownParamsObject> | null,
data?: any,
config?: AxiosRequestConfig
): OperationResponse<any>
}
Expected generated OperationMethods
:
export interface OperationMethods {
/**
* Annotations.put - Replace Annotations
*/
'Annotations.put'(
parameters?: Parameters<Paths.AnnotationsPut.PathParameters> | null,
data?: Paths.AnnotationsPut.RequestBody,
config?: AxiosRequestConfig
): OperationResponse<Paths.AnnotationsPut.Responses.$200>;
}
I am using the same version.
Note: my openapi spec seems to be valid and use well with other tools ng-openapi-gen
.
Thx for your help.
Issue from second comment fixed by #96
but original problem is there
https://github.com/anttiviljami/openapi-client-axios/blob/master/packages/typegen/src/typegen.ts#L80
I can't found in exportTypes
any */pathParameters
, just *parameter/0
,*parameter/1
Possible solution https://github.com/anttiviljami/openapi-client-axios/pull/96/commits/b74bf168e571287fcc0297f9a6758208b6ba2914
Thx @npdev453 , I confirm that #96 fix my trouble.
Hello, this is my use case :
I have a swagger yaml file like that
After apply
typegen file.yaml > file.d.ts
I have this result.In this case,
getIndicatorsLevels
doesn't include my reference inparameters
object. Instead it use aUnknownParamsObject
! But, if I check thenamespace GetIndicatorsLevels
, I have this parameters, but not the QueryParameters interfaceI'm on
openapi-client-axios-typegen@4.3.3
openapi-client-axios@4.3.3
Can you reproduce the problem or is it a YAML file problem ? Thank you in advance :)