From 7e19fddd9ba8194895df5c27295eb2316ea4c1e6 Mon Sep 17 00:00:00 2001 From: Stijn Van Hulle Date: Mon, 19 Feb 2024 17:41:10 +0100 Subject: [PATCH] docs: simple python example --- .codesandbox/ci.json | 1 + docs/.vitepress/config.ts | 4 + docs/examples/python.md | 18 + docs/plugins/react/components/editor.md | 2 - .../clients/axios/userService/createUser.kt | 16 - .../clients/axios/userService/createUser.py | 5 - .../userService/createUsersWithListInput.kt | 16 - .../userService/createUsersWithListInput.py | 5 - .../clients/axios/userService/deleteUser.kt | 16 - .../clients/axios/userService/deleteUser.py | 5 - .../axios/userService/getUserByName.kt | 16 - .../axios/userService/getUserByName.py | 5 - .../clients/axios/userService/loginUser.kt | 16 - .../clients/axios/userService/loginUser.py | 5 - .../clients/axios/userService/logoutUser.kt | 16 - .../clients/axios/userService/logoutUser.py | 5 - .../clients/axios/userService/updateUser.kt | 16 - .../clients/axios/userService/updateUser.py | 5 - .../client/templates/CustomClientTemplate.tsx | 61 +- .../templates/CustomClientTemplates.tsx | 23 - examples/python/.prettierrc | 9 + examples/python/kubb.config.ts | 37 + examples/python/package.json | 42 + examples/python/petStore.yaml | 969 ++++++++++++++++++ examples/python/src/gen/petService/addPet.py | 2 + .../python/src/gen/petService/deletePet.py | 2 + .../src/gen/petService/findPetsByStatus.py | 2 + .../src/gen/petService/findPetsByTags.py | 2 + .../python/src/gen/petService/getPetById.py | 2 + .../python/src/gen/petService/updatePet.py | 2 + .../src/gen/petService/updatePetWithForm.py | 2 + .../python/src/gen/petService/uploadFile.py | 2 + .../python/src/gen/petsService/createPets.py | 2 + .../src/gen/storeService/deleteOrder.py | 2 + .../src/gen/storeService/getInventory.py | 2 + .../src/gen/storeService/getOrderById.py | 2 + .../python/src/gen/storeService/placeOrder.py | 2 + .../src/gen/storeService/placeOrderPatch.py | 2 + .../python/src/gen/userService/createUser.py | 2 + .../userService/createUsersWithListInput.py | 2 + .../python/src/gen/userService/deleteUser.py | 2 + .../src/gen/userService/getUserByName.py | 2 + .../python/src/gen/userService/loginUser.py | 2 + .../python/src/gen/userService/logoutUser.py | 2 + .../python/src/gen/userService/updateUser.py | 2 + examples/python/src/index.ts | 0 .../python/templates/CustomClientTemplate.tsx | 32 + examples/python/tsconfig.json | 28 + examples/python/tsup.config.ts | 12 + packages/core/src/FileManager.ts | 4 +- .../swagger-client/src/components/Client.tsx | 3 +- .../src/components/Operations.tsx | 27 +- .../swagger-faker/src/components/Mutation.tsx | 34 +- .../swagger-faker/src/components/Query.tsx | 34 +- .../swagger-msw/src/components/Handlers.tsx | 26 +- packages/swagger-msw/src/components/Mock.tsx | 30 +- .../swagger-swr/src/components/Mutation.tsx | 72 +- packages/swagger-swr/src/components/Query.tsx | 74 +- .../src/components/Mutation.tsx | 74 +- .../src/components/Query.tsx | 144 +-- .../swagger-ts/src/components/Mutation.tsx | 34 +- packages/swagger-ts/src/components/Oas.tsx | 26 +- packages/swagger-ts/src/components/Query.tsx | 34 +- .../swagger-zod/src/components/Mutation.tsx | 34 +- packages/swagger-zod/src/components/Query.tsx | 34 +- .../src/components/Definitions.tsx | 28 +- pnpm-lock.yaml | 37 + 67 files changed, 1618 insertions(+), 558 deletions(-) create mode 100644 docs/examples/python.md delete mode 100644 examples/client/src/gen/clients/axios/userService/createUser.kt delete mode 100644 examples/client/src/gen/clients/axios/userService/createUser.py delete mode 100644 examples/client/src/gen/clients/axios/userService/createUsersWithListInput.kt delete mode 100644 examples/client/src/gen/clients/axios/userService/createUsersWithListInput.py delete mode 100644 examples/client/src/gen/clients/axios/userService/deleteUser.kt delete mode 100644 examples/client/src/gen/clients/axios/userService/deleteUser.py delete mode 100644 examples/client/src/gen/clients/axios/userService/getUserByName.kt delete mode 100644 examples/client/src/gen/clients/axios/userService/getUserByName.py delete mode 100644 examples/client/src/gen/clients/axios/userService/loginUser.kt delete mode 100644 examples/client/src/gen/clients/axios/userService/loginUser.py delete mode 100644 examples/client/src/gen/clients/axios/userService/logoutUser.kt delete mode 100644 examples/client/src/gen/clients/axios/userService/logoutUser.py delete mode 100644 examples/client/src/gen/clients/axios/userService/updateUser.kt delete mode 100644 examples/client/src/gen/clients/axios/userService/updateUser.py delete mode 100644 examples/client/templates/CustomClientTemplates.tsx create mode 100644 examples/python/.prettierrc create mode 100644 examples/python/kubb.config.ts create mode 100644 examples/python/package.json create mode 100644 examples/python/petStore.yaml create mode 100644 examples/python/src/gen/petService/addPet.py create mode 100644 examples/python/src/gen/petService/deletePet.py create mode 100644 examples/python/src/gen/petService/findPetsByStatus.py create mode 100644 examples/python/src/gen/petService/findPetsByTags.py create mode 100644 examples/python/src/gen/petService/getPetById.py create mode 100644 examples/python/src/gen/petService/updatePet.py create mode 100644 examples/python/src/gen/petService/updatePetWithForm.py create mode 100644 examples/python/src/gen/petService/uploadFile.py create mode 100644 examples/python/src/gen/petsService/createPets.py create mode 100644 examples/python/src/gen/storeService/deleteOrder.py create mode 100644 examples/python/src/gen/storeService/getInventory.py create mode 100644 examples/python/src/gen/storeService/getOrderById.py create mode 100644 examples/python/src/gen/storeService/placeOrder.py create mode 100644 examples/python/src/gen/storeService/placeOrderPatch.py create mode 100644 examples/python/src/gen/userService/createUser.py create mode 100644 examples/python/src/gen/userService/createUsersWithListInput.py create mode 100644 examples/python/src/gen/userService/deleteUser.py create mode 100644 examples/python/src/gen/userService/getUserByName.py create mode 100644 examples/python/src/gen/userService/loginUser.py create mode 100644 examples/python/src/gen/userService/logoutUser.py create mode 100644 examples/python/src/gen/userService/updateUser.py create mode 100644 examples/python/src/index.ts create mode 100644 examples/python/templates/CustomClientTemplate.tsx create mode 100644 examples/python/tsconfig.json create mode 100644 examples/python/tsup.config.ts diff --git a/.codesandbox/ci.json b/.codesandbox/ci.json index 8c33520f6..6d2c233c7 100644 --- a/.codesandbox/ci.json +++ b/.codesandbox/ci.json @@ -18,6 +18,7 @@ "/examples/advanced", "/examples/faker", "/examples/msw", + "/examples/python", "/examples/msw-v2", "/examples/react-query", "/examples/react-query-v5", diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index f7fcd0333..abf0ab7e3 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -346,6 +346,10 @@ const examplesSidebar = [ text: 'Templates new', link: '/examples/client', }, + { + text: 'Python new', + link: '/examples/python', + }, ] const blogSidebar = [ diff --git a/docs/examples/python.md b/docs/examples/python.md new file mode 100644 index 000000000..cd776c09f --- /dev/null +++ b/docs/examples/python.md @@ -0,0 +1,18 @@ +--- +title: Python PetStore +aside: false +--- + +