Skip to content

Commit

Permalink
Merge pull request #1471 from hey-api/fix/client-descriptions
Browse files Browse the repository at this point in the history
fix: add links to the experimental parser callouts
  • Loading branch information
mrlubos authored Dec 19, 2024
2 parents 670e537 + f86d293 commit 994286e
Show file tree
Hide file tree
Showing 11 changed files with 52 additions and 9 deletions.
7 changes: 7 additions & 0 deletions .changeset/lovely-lies-impress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@hey-api/client-axios': patch
'@hey-api/client-fetch': patch
'@hey-api/openapi-ts': patch
---

fix: add links to the experimental parser callouts
6 changes: 6 additions & 0 deletions packages/client-axios/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,15 @@ type OmitKeys<T, K> = Pick<T, Exclude<keyof T, K>>;
export interface Config<ThrowOnError extends boolean = boolean>
extends Omit<CreateAxiosDefaults, 'headers'> {
/**
* **This feature works only with the [experimental parser](https://heyapi.dev/openapi-ts/configuration#parser)**
*
* Access token or a function returning access token. The resolved token will
* be added to request payload as required.
*/
accessToken?: (() => Promise<string | undefined>) | string | undefined;
/**
* **This feature works only with the [experimental parser](https://heyapi.dev/openapi-ts/configuration#parser)**
*
* API key or a function returning API key. The resolved key will be added
* to the request payload as required.
*/
Expand Down Expand Up @@ -88,6 +92,8 @@ export interface Config<ThrowOnError extends boolean = boolean>
*/
responseTransformer?: (data: unknown) => Promise<unknown>;
/**
* **This feature works only with the [experimental parser](https://heyapi.dev/openapi-ts/configuration#parser)**
*
* A function validating response data. This is useful if you want to ensure
* the response conforms to the desired shape, so it can be safely passed to
* the transformers and returned to the user.
Expand Down
6 changes: 6 additions & 0 deletions packages/client-fetch/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@ type OmitKeys<T, K> = Pick<T, Exclude<keyof T, K>>;
export interface Config<ThrowOnError extends boolean = boolean>
extends Omit<RequestInit, 'body' | 'headers' | 'method'> {
/**
* **This feature works only with the [experimental parser](https://heyapi.dev/openapi-ts/configuration#parser)**
*
* Access token or a function returning access token. The resolved token
* will be added to request headers where it's required.
*/
accessToken?: (() => Promise<string | undefined>) | string | undefined;
/**
* **This feature works only with the [experimental parser](https://heyapi.dev/openapi-ts/configuration#parser)**
*
* API key or a function returning API key. The resolved key will be added
* to the request payload as required.
*/
Expand Down Expand Up @@ -93,6 +97,8 @@ export interface Config<ThrowOnError extends boolean = boolean>
*/
responseTransformer?: (data: unknown) => Promise<unknown>;
/**
* **This feature works only with the [experimental parser](https://heyapi.dev/openapi-ts/configuration#parser)**
*
* A function validating response data. This is useful if you want to ensure
* the response conforms to the desired shape, so it can be safely passed to
* the transformers and returned to the user.
Expand Down
4 changes: 2 additions & 2 deletions packages/openapi-ts/src/plugins/@hey-api/sdk/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface Config extends Plugin.Name<'@hey-api/sdk'> {
*/
asClass?: boolean;
/**
* **This feature works only with the experimental parser**
* **This feature works only with the [experimental parser](https://heyapi.dev/openapi-ts/configuration#parser)**
*
* Should the generated functions contain auth mechanisms? You may want to
* disable this option if you're handling auth yourself or defining it
Expand Down Expand Up @@ -90,7 +90,7 @@ export interface Config extends Plugin.Name<'@hey-api/sdk'> {
*/
transformer?: '@hey-api/transformers' | boolean;
/**
* **This feature works only with the experimental parser**
* **This feature works only with the [experimental parser](https://heyapi.dev/openapi-ts/configuration#parser)**
*
* Validate response data against schema before returning. This is useful
* if you want to ensure the response conforms to a desired shape. However,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export interface Config extends Plugin.Name<'@hey-api/typescript'> {
*/
enums?: 'javascript' | 'typescript' | 'typescript+namespace' | false;
/**
* **This feature works only with the experimental parser**
* **This feature works only with the [experimental parser](https://heyapi.dev/openapi-ts/configuration#parser)**
*
* Defines casing of the enum keys. By default, we use `SCREAMING_SNAKE_CASE`.
* This option has effect only when `enums` is defined.
Expand All @@ -20,7 +20,7 @@ export interface Config extends Plugin.Name<'@hey-api/typescript'> {
*/
enumsCase?: StringCase;
/**
* **This feature works only with the experimental parser**
* **This feature works only with the [experimental parser](https://heyapi.dev/openapi-ts/configuration#parser)**
*
* By default, inline enums (enums not defined as reusable components in
* the input file) are generated as inlined union types. You can set
Expand All @@ -31,7 +31,7 @@ export interface Config extends Plugin.Name<'@hey-api/typescript'> {
*/
exportInlineEnums?: boolean;
/**
* **This feature works only with the experimental parser**
* **This feature works only with the [experimental parser](https://heyapi.dev/openapi-ts/configuration#parser)**
*
* Defines casing of the identifiers. By default, we use `PascalCase`.
*
Expand Down
2 changes: 1 addition & 1 deletion packages/openapi-ts/src/plugins/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export interface PluginContext {

interface BaseConfig {
/**
* **This feature works only with the experimental parser**
* **This feature works only with the [experimental parser](https://heyapi.dev/openapi-ts/configuration#parser)**
*
* Should the exports from the plugin's file be re-exported in the index
* barrel file?
Expand Down
6 changes: 3 additions & 3 deletions packages/openapi-ts/src/types/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export interface ClientConfig {
| Record<string, unknown>
| {
/**
* **This feature works only with the experimental parser**
* **This feature works only with the [experimental parser](https://heyapi.dev/openapi-ts/configuration#parser)**
*
* Prevent parts matching the regular expression from being processed.
* You can select both operations and components by reference within
Expand All @@ -94,7 +94,7 @@ export interface ClientConfig {
*/
exclude?: string;
/**
* **This feature works only with the experimental parser**
* **This feature works only with the [experimental parser](https://heyapi.dev/openapi-ts/configuration#parser)**
*
* Process only parts matching the regular expression. You can select both
* operations and components by reference within the bundled input. In
Expand Down Expand Up @@ -159,7 +159,7 @@ export interface ClientConfig {
| string
| {
/**
* **This feature works only with the experimental parser**
* **This feature works only with the [experimental parser](https://heyapi.dev/openapi-ts/configuration#parser)**
*
* Defines casing of the output fields. By default, we preserve `input`
* values as data transforms incur a performance penalty at runtime.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,15 @@ type OmitKeys<T, K> = Pick<T, Exclude<keyof T, K>>;
export interface Config<ThrowOnError extends boolean = boolean>
extends Omit<CreateAxiosDefaults, 'headers'> {
/**
* **This feature works only with the [experimental parser](https://heyapi.dev/openapi-ts/configuration#parser)**
*
* Access token or a function returning access token. The resolved token will
* be added to request payload as required.
*/
accessToken?: (() => Promise<string | undefined>) | string | undefined;
/**
* **This feature works only with the [experimental parser](https://heyapi.dev/openapi-ts/configuration#parser)**
*
* API key or a function returning API key. The resolved key will be added
* to the request payload as required.
*/
Expand Down Expand Up @@ -88,6 +92,8 @@ export interface Config<ThrowOnError extends boolean = boolean>
*/
responseTransformer?: (data: unknown) => Promise<unknown>;
/**
* **This feature works only with the [experimental parser](https://heyapi.dev/openapi-ts/configuration#parser)**
*
* A function validating response data. This is useful if you want to ensure
* the response conforms to the desired shape, so it can be safely passed to
* the transformers and returned to the user.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,15 @@ type OmitKeys<T, K> = Pick<T, Exclude<keyof T, K>>;
export interface Config<ThrowOnError extends boolean = boolean>
extends Omit<CreateAxiosDefaults, 'headers'> {
/**
* **This feature works only with the [experimental parser](https://heyapi.dev/openapi-ts/configuration#parser)**
*
* Access token or a function returning access token. The resolved token will
* be added to request payload as required.
*/
accessToken?: (() => Promise<string | undefined>) | string | undefined;
/**
* **This feature works only with the [experimental parser](https://heyapi.dev/openapi-ts/configuration#parser)**
*
* API key or a function returning API key. The resolved key will be added
* to the request payload as required.
*/
Expand Down Expand Up @@ -88,6 +92,8 @@ export interface Config<ThrowOnError extends boolean = boolean>
*/
responseTransformer?: (data: unknown) => Promise<unknown>;
/**
* **This feature works only with the [experimental parser](https://heyapi.dev/openapi-ts/configuration#parser)**
*
* A function validating response data. This is useful if you want to ensure
* the response conforms to the desired shape, so it can be safely passed to
* the transformers and returned to the user.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@ type OmitKeys<T, K> = Pick<T, Exclude<keyof T, K>>;
export interface Config<ThrowOnError extends boolean = boolean>
extends Omit<RequestInit, 'body' | 'headers' | 'method'> {
/**
* **This feature works only with the [experimental parser](https://heyapi.dev/openapi-ts/configuration#parser)**
*
* Access token or a function returning access token. The resolved token
* will be added to request headers where it's required.
*/
accessToken?: (() => Promise<string | undefined>) | string | undefined;
/**
* **This feature works only with the [experimental parser](https://heyapi.dev/openapi-ts/configuration#parser)**
*
* API key or a function returning API key. The resolved key will be added
* to the request payload as required.
*/
Expand Down Expand Up @@ -93,6 +97,8 @@ export interface Config<ThrowOnError extends boolean = boolean>
*/
responseTransformer?: (data: unknown) => Promise<unknown>;
/**
* **This feature works only with the [experimental parser](https://heyapi.dev/openapi-ts/configuration#parser)**
*
* A function validating response data. This is useful if you want to ensure
* the response conforms to the desired shape, so it can be safely passed to
* the transformers and returned to the user.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@ type OmitKeys<T, K> = Pick<T, Exclude<keyof T, K>>;
export interface Config<ThrowOnError extends boolean = boolean>
extends Omit<RequestInit, 'body' | 'headers' | 'method'> {
/**
* **This feature works only with the [experimental parser](https://heyapi.dev/openapi-ts/configuration#parser)**
*
* Access token or a function returning access token. The resolved token
* will be added to request headers where it's required.
*/
accessToken?: (() => Promise<string | undefined>) | string | undefined;
/**
* **This feature works only with the [experimental parser](https://heyapi.dev/openapi-ts/configuration#parser)**
*
* API key or a function returning API key. The resolved key will be added
* to the request payload as required.
*/
Expand Down Expand Up @@ -93,6 +97,8 @@ export interface Config<ThrowOnError extends boolean = boolean>
*/
responseTransformer?: (data: unknown) => Promise<unknown>;
/**
* **This feature works only with the [experimental parser](https://heyapi.dev/openapi-ts/configuration#parser)**
*
* A function validating response data. This is useful if you want to ensure
* the response conforms to the desired shape, so it can be safely passed to
* the transformers and returned to the user.
Expand Down

0 comments on commit 994286e

Please sign in to comment.