{ "openapi": "3.0.0", "info": { "title": "API Produk & Pesanan", "description": "Dokumentasi API Produk dan Pemesanan", "version": "1.0.0" }, "paths": { "/api/produk": { "get": { "summary": "Menampilkan semua produk", "operationId": "3c74aa47134424450a7cf8e1942a2172", "responses": { "200": { "description": "Sukses menampilkan data produk" } } }, "post": { "summary": "Menambahkan produk baru", "operationId": "b907cee0c19dc0ebb3146af85fe73143", "requestBody": { "required": true, "content": { "application/json": { "schema": { "required": [ "nama", "harga" ], "properties": { "nama": { "type": "string", "example": "sepatu" }, "harga": { "type": "number", "example": 120000 }, "gambar": { "type": "string", "example": "fans.png" } }, "type": "object" } } } }, "responses": { "201": { "description": "Produk berhasil ditambahkan" } } } }, "/api/produk/{id}": { "get": { "summary": "Menampilkan detail produk", "operationId": "b11bed705c490d1b2fbf7bed8851b366", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Detail produk ditemukan" }, "404": { "description": "Produk tidak ditemukan" } } }, "put": { "summary": "Memperbarui data produk", "operationId": "f29178e0a53044bac04c80b3f75b3699", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "nama": { "type": "string", "example": "fans" }, "harga": { "type": "number", "example": 95000 }, "gambar": { "type": "string", "example": "fans.jpg" } }, "type": "object" } } } }, "responses": { "200": { "description": "Produk berhasil diperbarui" }, "404": { "description": "Produk tidak ditemukan" } } }, "delete": { "summary": "Menghapus produk", "operationId": "b8fdf38f18c6945a8c51071f27472550", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Produk berhasil dihapus" }, "404": { "description": "Produk tidak ditemukan" } } } }, "/api/pesanan": { "post": { "summary": "Melakukan pemesanan produk", "operationId": "ca4dc4a0a8c3f76e39ea7f6c56df7423", "requestBody": { "required": true, "content": { "application/json": { "schema": { "required": [ "nama", "product", "jumlah" ], "properties": { "nama": { "type": "string", "example": "Fans" }, "product": { "type": "string", "example": "sepatu" }, "jumlah": { "type": "integer", "example": 3 } }, "type": "object" } } } }, "responses": { "201": { "description": "Pesanan berhasil dibuat" } } } } } }