Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ image:


gen-api:
./gradlew generateApiCode
./gradlew app:generateApiCode

gen-docs:
./gradlew generateSwaggerUI
Expand Down
1 change: 1 addition & 0 deletions api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,5 @@ tasks.register('generateOpenApi') {
clean {
delete 'build/openapi'
delete 'node_modules'
delete 'typescript'
}
10 changes: 10 additions & 0 deletions api/typescript/.openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
src/models/CreatePetRequest.ts
src/models/CreatePetResponse.ts
src/models/ErrorResponse.ts
src/models/GetPetResponse.ts
src/models/ListPetsResponse.ts
src/models/Pet.ts
src/models/ServiceInfo.ts
src/models/ServiceInfoResponse.ts
src/models/UpdatePetRequest.ts
src/models/UpdatePetResponse.ts
1 change: 1 addition & 0 deletions api/typescript/.openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7.8.0
13 changes: 13 additions & 0 deletions api/typescript/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Auto-generated TypeScript models for Pet Shop API
// Generated from OpenAPI specification

export * from './src/models/Pet';
export * from './src/models/CreatePetRequest';
export * from './src/models/CreatePetResponse';
export * from './src/models/UpdatePetRequest';
export * from './src/models/UpdatePetResponse';
export * from './src/models/GetPetResponse';
export * from './src/models/ListPetsResponse';
export * from './src/models/ErrorResponse';
export * from './src/models/ServiceInfo';
export * from './src/models/ServiceInfoResponse';
103 changes: 103 additions & 0 deletions api/typescript/src/models/CreatePetRequest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
/* tslint:disable */
/* eslint-disable */
/**
* Pet Shop API
* Pet Shop API A comprehensive example of Micronaut application best practices for a pet shop
*
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/

import { mapValues } from '../runtime';
/**
* Pet creation request
* @export
* @interface CreatePetRequest
*/
export interface CreatePetRequest {
/**
* Pet's name
* @type {string}
* @memberof CreatePetRequest
*/
name: string;
/**
* Pet species (e.g., dog, cat, bird)
* @type {string}
* @memberof CreatePetRequest
*/
species: string;
/**
* Pet breed
* @type {string}
* @memberof CreatePetRequest
*/
breed?: string;
/**
* Pet age in years
* @type {number}
* @memberof CreatePetRequest
*/
age: number;
/**
* Pet color
* @type {string}
* @memberof CreatePetRequest
*/
color?: string;
/**
* Pet description
* @type {string}
* @memberof CreatePetRequest
*/
description?: string;
}

/**
* Check if a given object implements the CreatePetRequest interface.
*/
export function instanceOfCreatePetRequest(value: object): value is CreatePetRequest {
if (!('name' in value) || value['name'] === undefined) return false;
if (!('species' in value) || value['species'] === undefined) return false;
if (!('age' in value) || value['age'] === undefined) return false;
return true;
}

export function CreatePetRequestFromJSON(json: any): CreatePetRequest {
return CreatePetRequestFromJSONTyped(json, false);
}

export function CreatePetRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreatePetRequest {
if (json == null) {
return json;
}
return {

'name': json['name'],
'species': json['species'],
'breed': json['breed'] == null ? undefined : json['breed'],
'age': json['age'],
'color': json['color'] == null ? undefined : json['color'],
'description': json['description'] == null ? undefined : json['description'],
};
}

export function CreatePetRequestToJSON(value?: CreatePetRequest | null): any {
if (value == null) {
return value;
}
return {

'name': value['name'],
'species': value['species'],
'breed': value['breed'],
'age': value['age'],
'color': value['color'],
'description': value['description'],
};
}

68 changes: 68 additions & 0 deletions api/typescript/src/models/CreatePetResponse.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/* tslint:disable */
/* eslint-disable */
/**
* Pet Shop API
* Pet Shop API A comprehensive example of Micronaut application best practices for a pet shop
*
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/

import { mapValues } from '../runtime';
import type { Pet } from './Pet';
import {
PetFromJSON,
PetFromJSONTyped,
PetToJSON,
} from './Pet';

/**
* Pet creation response
* @export
* @interface CreatePetResponse
*/
export interface CreatePetResponse {
/**
*
* @type {Pet}
* @memberof CreatePetResponse
*/
pet: Pet;
}

/**
* Check if a given object implements the CreatePetResponse interface.
*/
export function instanceOfCreatePetResponse(value: object): value is CreatePetResponse {
if (!('pet' in value) || value['pet'] === undefined) return false;
return true;
}

export function CreatePetResponseFromJSON(json: any): CreatePetResponse {
return CreatePetResponseFromJSONTyped(json, false);
}

export function CreatePetResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreatePetResponse {
if (json == null) {
return json;
}
return {

'pet': PetFromJSON(json['pet']),
};
}

export function CreatePetResponseToJSON(value?: CreatePetResponse | null): any {
if (value == null) {
return value;
}
return {

'pet': PetToJSON(value['pet']),
};
}

69 changes: 69 additions & 0 deletions api/typescript/src/models/ErrorResponse.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/* tslint:disable */
/* eslint-disable */
/**
* Pet Shop API
* Pet Shop API A comprehensive example of Micronaut application best practices for a pet shop
*
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/

import { mapValues } from '../runtime';
/**
* Error response
* @export
* @interface ErrorResponse
*/
export interface ErrorResponse {
/**
* Error message
* @type {string}
* @memberof ErrorResponse
*/
message: string;
/**
* Error details
* @type {string}
* @memberof ErrorResponse
*/
details?: string;
}

/**
* Check if a given object implements the ErrorResponse interface.
*/
export function instanceOfErrorResponse(value: object): value is ErrorResponse {
if (!('message' in value) || value['message'] === undefined) return false;
return true;
}

export function ErrorResponseFromJSON(json: any): ErrorResponse {
return ErrorResponseFromJSONTyped(json, false);
}

export function ErrorResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ErrorResponse {
if (json == null) {
return json;
}
return {

'message': json['message'],
'details': json['details'] == null ? undefined : json['details'],
};
}

export function ErrorResponseToJSON(value?: ErrorResponse | null): any {
if (value == null) {
return value;
}
return {

'message': value['message'],
'details': value['details'],
};
}

68 changes: 68 additions & 0 deletions api/typescript/src/models/GetPetResponse.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/* tslint:disable */
/* eslint-disable */
/**
* Pet Shop API
* Pet Shop API A comprehensive example of Micronaut application best practices for a pet shop
*
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/

import { mapValues } from '../runtime';
import type { Pet } from './Pet';
import {
PetFromJSON,
PetFromJSONTyped,
PetToJSON,
} from './Pet';

/**
* Get pet response
* @export
* @interface GetPetResponse
*/
export interface GetPetResponse {
/**
*
* @type {Pet}
* @memberof GetPetResponse
*/
pet: Pet;
}

/**
* Check if a given object implements the GetPetResponse interface.
*/
export function instanceOfGetPetResponse(value: object): value is GetPetResponse {
if (!('pet' in value) || value['pet'] === undefined) return false;
return true;
}

export function GetPetResponseFromJSON(json: any): GetPetResponse {
return GetPetResponseFromJSONTyped(json, false);
}

export function GetPetResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetPetResponse {
if (json == null) {
return json;
}
return {

'pet': PetFromJSON(json['pet']),
};
}

export function GetPetResponseToJSON(value?: GetPetResponse | null): any {
if (value == null) {
return value;
}
return {

'pet': PetToJSON(value['pet']),
};
}

Loading