Repository navigation
refactor: cleanup interfaces + add missing methods from parser-api - #597
Conversation
| export type SecuritySchemaType = 'userPassword' | 'apiKey' | 'X509' | 'symmetricEncryption' | 'asymmetricEncryption' | 'httpApiKey' | 'http' | 'oauth2' | 'openIdConnect' | 'plain' | 'scramSha256' | 'scramSha512' | 'gssapi'; | ||
| export type SecuritySchemaLocation = 'user' | 'password' | 'query' | 'header' | 'header' | 'cookie'; |
There was a problem hiding this comment.
Hmm 🤔 Probably we should move that types to the spec-types/v2. SecuritySchemaType probably I wrote but we have missed SecuritySchemaLocation here. Could you move them?
There was a problem hiding this comment.
Those are already in spec-types/v2. The question is, should we also add all of them (meaning all locations possible, no matters the version of the spec) in the interface?That was the idea behind this in parser-api: https://github.com/asyncapi/parser-api/pull/71/files#diff-ac35ac6e0b0ad3629802a0e04076aa18e94da614f5392e1164dcaacdfe3ee198R375.
WDYT?
There was a problem hiding this comment.
Yeah, we don't make different spec types for 2.0.0, 2.1.0 etc. v2 spec types is for 2.x.x, so please use types from spec-types/v2.
There was a problem hiding this comment.
v2 spec types is for 2.x.x, so please use types from spec-types/v2
But we are talking about types located in the interface (src/models/security-scheme.ts). Not related with the implementation.
There was a problem hiding this comment.
Do you mean we should just use string as type here, and in the implementation (v2, v3...) to set those values as unique possible values for that string?
There was a problem hiding this comment.
We can even use v2.SecuritySchemaLocation | v3.SecuritySchemaLocation type in the future, but probably better will be string and then in implementation cast type to the v2.SecuritySchemaLocation. Please change to the string and move types to the spec-types/v2
Co-authored-by: Maciej Urbańczyk <[email protected]>
Co-authored-by: Maciej Urbańczyk <[email protected]>
|
Kudos, SonarCloud Quality Gate passed! |
|
/rtm |








Description
This PR does a cleanup and sync with the latest changes on
parser-apimade in asyncapi/parser-api#71 (comment).Related issue(s)