Skip to content

Commit d48d382

Browse files
author
Przemyslaw Brzosko
committed
Generated API from petstore.
1 parent ce7c253 commit d48d382

File tree

4 files changed

+120
-16
lines changed

4 files changed

+120
-16
lines changed

orval.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function modifyRecursive(obj: object, fn: (obj: object) => boolean) {
1414
export default defineConfig({
1515
swapi: {
1616
input: {
17-
target: "../../SwWeb2/api.json",
17+
target: "src/petstore.yaml",
1818
override: {
1919
transformer: (api) => {
2020
modifyRecursive(api, (value) => {

package-lock.json

+112-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@
1010
"author": "",
1111
"license": "ISC",
1212
"devDependencies": {
13+
"@tanstack/vue-query": "^5.51.9",
1314
"@types/node": "^20.11.27",
14-
"orval": "^7.0.0"
15+
"orval": "^7.0.0",
16+
"typescript": "^5.5.4"
1517
},
1618
"dependencies": {
1719
"vue": "^3.4.21"

src/TestComponent.vue

+4-13
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,9 @@
11
<script lang="ts" setup>
2-
import {ref} from "vue";
2+
import {useShowPetById} from "./api/pets/pets";
33
4-
const submitted = ref(false);
4+
const {data: pet, error: petError} = useShowPetById("100");
55
</script>
66
<template>
7-
<div v-if="submitted">
8-
Form Submitted
9-
<button @click="submitted = false">Reset</button>
10-
</div>
11-
<form :style="{display: 'flex', flexDirection: 'column'}" @submit.prevent="submitted = true" v-else>
12-
<label for="username">Username</label>
13-
<input id="username" type="text">
14-
<label for="password">Password</label>
15-
<input id="password" type="password">
16-
<button type="submit">Login</button>
17-
</form>
7+
<div v-if="petError">{{petError}}</div>
8+
<div v-else>{{pet}}</div>
189
</template>

0 commit comments

Comments
 (0)