Skip to content

Commit

Permalink
docs(samples): update
Browse files Browse the repository at this point in the history
  • Loading branch information
anymaniax committed Dec 6, 2023
1 parent bfc867c commit cf574f6
Show file tree
Hide file tree
Showing 114 changed files with 381 additions and 329 deletions.
2 changes: 1 addition & 1 deletion samples/angular-app/src/api/endpoints/pets/pets.msw.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Generated by orval v6.21.0 🍺
* Generated by orval v6.22.0 🍺
* Do not edit manually.
* Swagger Petstore
* OpenAPI spec version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion samples/angular-app/src/api/endpoints/pets/pets.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Generated by orval v6.21.0 🍺
* Generated by orval v6.22.0 🍺
* Do not edit manually.
* Swagger Petstore
* OpenAPI spec version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion samples/angular-app/src/api/model/createPetsBody.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Generated by orval v6.21.0 🍺
* Generated by orval v6.22.0 🍺
* Do not edit manually.
* Swagger Petstore
* OpenAPI spec version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion samples/angular-app/src/api/model/error.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Generated by orval v6.21.0 🍺
* Generated by orval v6.22.0 🍺
* Do not edit manually.
* Swagger Petstore
* OpenAPI spec version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion samples/angular-app/src/api/model/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Generated by orval v6.21.0 🍺
* Generated by orval v6.22.0 🍺
* Do not edit manually.
* Swagger Petstore
* OpenAPI spec version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion samples/angular-app/src/api/model/listPetsParams.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Generated by orval v6.21.0 🍺
* Generated by orval v6.22.0 🍺
* Do not edit manually.
* Swagger Petstore
* OpenAPI spec version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion samples/angular-app/src/api/model/pet.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Generated by orval v6.21.0 🍺
* Generated by orval v6.22.0 🍺
* Do not edit manually.
* Swagger Petstore
* OpenAPI spec version: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion samples/angular-app/src/api/model/pets.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Generated by orval v6.21.0 🍺
* Generated by orval v6.22.0 🍺
* Do not edit manually.
* Swagger Petstore
* OpenAPI spec version: 1.0.0
Expand Down
66 changes: 38 additions & 28 deletions samples/basic/api/endpoints/petstoreFromFileSpec.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
/**
* Generated by orval v6.21.0 🍺
* Generated by orval v6.22.0 🍺
* Do not edit manually.
* Swagger Petstore
* OpenAPI spec version: 1.0.0
*/
import axios from 'axios';
import type { AxiosRequestConfig, AxiosResponse } from 'axios';
import axios from 'axios'
import type {
AxiosRequestConfig,
AxiosResponse
} from 'axios'
export type CreatePetsBody = {
name: string;
tag: string;
};

export type ListPetsParams = {
/**
* How many items to return at one time (max 100)
*/
limit?: string;
/**
* How many items to return at one time (max 100)
*/
limit?: string;
};

export interface Error {
Expand All @@ -31,39 +34,46 @@ export interface Pet {

export type Pets = Pet[];

/**




/**
* @summary List all pets
*/
export const listPets = <TData = AxiosResponse<Pets>>(
params?: ListPetsParams,
options?: AxiosRequestConfig,
): Promise<TData> => {
return axios.get(`/pets`, {
params?: ListPetsParams, options?: AxiosRequestConfig
): Promise<TData> => {
return axios.get(
`/pets`,{
...options,
params: { ...params, ...options?.params },
});
};
params: {...params, ...options?.params},}
);
}

/**
* @summary Create a pet
*/
export const createPets = <TData = AxiosResponse<void>>(
createPetsBody: CreatePetsBody,
options?: AxiosRequestConfig,
): Promise<TData> => {
return axios.post(`/pets`, createPetsBody, options);
};
createPetsBody: CreatePetsBody, options?: AxiosRequestConfig
): Promise<TData> => {
return axios.post(
`/pets`,
createPetsBody,options
);
}

/**
* @summary Info for a specific pet
*/
export const showPetById = <TData = AxiosResponse<Pet>>(
petId: string,
options?: AxiosRequestConfig,
): Promise<TData> => {
return axios.get(`/pets/${petId}`, options);
};
petId: string, options?: AxiosRequestConfig
): Promise<TData> => {
return axios.get(
`/pets/${petId}`,options
);
}

export type ListPetsResult = AxiosResponse<Pets>;
export type CreatePetsResult = AxiosResponse<void>;
export type ShowPetByIdResult = AxiosResponse<Pet>;
export type ListPetsResult = AxiosResponse<Pets>
export type CreatePetsResult = AxiosResponse<void>
export type ShowPetByIdResult = AxiosResponse<Pet>
66 changes: 38 additions & 28 deletions samples/basic/api/endpoints/petstoreFromFileSpecWithConfig.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
/**
* Generated by orval v6.21.0 🍺
* Generated by orval v6.22.0 🍺
* Do not edit manually.
* Swagger Petstore
* OpenAPI spec version: 1.0.0
*/
import axios from 'axios';
import type { AxiosRequestConfig, AxiosResponse } from 'axios';
import axios from 'axios'
import type {
AxiosRequestConfig,
AxiosResponse
} from 'axios'
export type CreatePetsBody = {
name: string;
tag: string;
};

export type ListPetsParams = {
/**
* How many items to return at one time (max 100)
*/
limit?: string;
/**
* How many items to return at one time (max 100)
*/
limit?: string;
};

export interface Error {
Expand All @@ -31,39 +34,46 @@ export interface Pet {

export type Pets = Pet[];

/**




/**
* @summary List all pets
*/
export const listPets = <TData = AxiosResponse<Pets>>(
params?: ListPetsParams,
options?: AxiosRequestConfig,
): Promise<TData> => {
return axios.get(`/pets`, {
params?: ListPetsParams, options?: AxiosRequestConfig
): Promise<TData> => {
return axios.get(
`/pets`,{
...options,
params: { ...params, ...options?.params },
});
};
params: {...params, ...options?.params},}
);
}

/**
* @summary Create a pet
*/
export const createPets = <TData = AxiosResponse<void>>(
createPetsBody: CreatePetsBody,
options?: AxiosRequestConfig,
): Promise<TData> => {
return axios.post(`/pets`, createPetsBody, options);
};
createPetsBody: CreatePetsBody, options?: AxiosRequestConfig
): Promise<TData> => {
return axios.post(
`/pets`,
createPetsBody,options
);
}

/**
* @summary Info for a specific pet
*/
export const showPetById = <TData = AxiosResponse<Pet>>(
petId: string,
options?: AxiosRequestConfig,
): Promise<TData> => {
return axios.get(`/pets/${petId}`, options);
};
petId: string, options?: AxiosRequestConfig
): Promise<TData> => {
return axios.get(
`/pets/${petId}`,options
);
}

export type ListPetsResult = AxiosResponse<Pets>;
export type CreatePetsResult = AxiosResponse<void>;
export type ShowPetByIdResult = AxiosResponse<Pet>;
export type ListPetsResult = AxiosResponse<Pets>
export type CreatePetsResult = AxiosResponse<void>
export type ShowPetByIdResult = AxiosResponse<Pet>
Loading

0 comments on commit cf574f6

Please sign in to comment.