Skip to content

Commit 037d24f

Browse files
authored
Merge branch 'main' into fix/landingpage-product-section
2 parents 92ea4a9 + e5c914c commit 037d24f

File tree

2 files changed

+263
-10
lines changed

2 files changed

+263
-10
lines changed

src/components/QuickStartList.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ const quickstarts = [
267267
server: "Local",
268268
description:
269269
"A sample SMS Sending app to demonstrate how seamlessly Keploy integrates with FastAPI and Twilio.",
270-
link: "docs/quickstart/samples-fastapi-twilio/#running-app-locally-on-linuxwsl-",
270+
link: "/docs/quickstart/samples-fastapi-twilio/#running-app-locally-on-linuxwsl-",
271271
},
272272
{
273273
title: "FastAPI + Twilio ",
@@ -342,7 +342,7 @@ const quickstarts = [
342342
server: "Docker",
343343
description:
344344
"A sample CRUD app to demonstrate Keploy integration built with Node, JWT, and PostgreSQL.",
345-
link: "docs/quickstart/samples-node-jwt/#using-docker-compose-",
345+
link: "/docs/quickstart/samples-node-jwt/#using-docker-compose-",
346346
},
347347

348348
{

versioned_docs/version-3.0.0/quickstart/python-microservices.md

Lines changed: 261 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,14 +1052,16 @@ code={`
10521052

10531053
<img src="https://keploy-devrel.s3.us-west-2.amazonaws.com/microservices_postman_1.png" alt="Sample Keploy Record Microservices" width="100%" style={{ borderRadius: '5px' }} />
10541054

1055-
**Step 2: Once it is uploaded, you will see the Ecommerce microservices in the left tab.**
1055+
**Step 2: After the upload is complete, you will see the Ecommerce Microservices collection in the left panel. Open the collection to continue.**
10561056

10571057
<img src="https://keploy-devrel.s3.us-west-2.amazonaws.com/microservices_postman_2.png" alt="Sample Keploy Record Microservices" width="100%" style={{ borderRadius: '5px' }} />
10581058

1059-
**Step 3: Click the User Service and hit the login URL to get the token.**
1059+
**Step 3: Before sending any requests, ensure you have generated a JWT token. Click on User Service. Use the Login API and enter the following credentials: `Username: admin` and `Password: admin123`. After a successful login, you will receive a JWT token. Copy the token and paste it into your Environment settings.**
10601060

10611061
<img src="https://keploy-devrel.s3.us-west-2.amazonaws.com/microservices_postman_3.png" alt="Sample Keploy Record Microservices" width="100%" style={{ borderRadius: '5px' }} />
10621062

1063+
<img src="https://keploy-devrel.s3.us-west-2.amazonaws.com/keploy-jwt-microservices.png" alt="Sample Keploy Record Microservices" width="100%" style={{ borderRadius: '5px' }} />
1064+
10631065
**Step 4: We need to create a user before placing an order. So, create a user using the Create User API.**
10641066

10651067
<img src="https://keploy-devrel.s3.us-west-2.amazonaws.com/microservices_postman_4.png" alt="Sample Keploy Record Microservices" width="100%" style={{ borderRadius: '5px' }} />
@@ -1370,17 +1372,18 @@ After reaching this step, provide your application URL and the working cURL comm
13701372

13711373
**Step 1: Let's provide the curl command in the import curl section**
13721374

1373-
<img src="https://keploy-devrel.s3.us-west-2.amazonaws.com/keploy_apitesting_2.png" alt="Sample Keploy Record Microservices" />
1375+
<img src="https://keploy-devrel.s3.us-west-2.amazonaws.com/keploy_inital_curl_request.png" alt="Sample Keploy Record Microservices" />
13741376

13751377
Use the following cURL command to import:
13761378

13771379
```bash
1378-
curl -X POST -H 'Host: localhost:8080' -H 'Accept-Encoding: gzip, deflate, br' -H 'Connection: keep-alive' -H 'Cache-Control: no-cache' -H 'Accept: */*' -H 'Postman-Token: 682f4ac6-a482-44ab-b7f4-14cd4e8bc989' -H 'User-Agent: PostmanRuntime/7.49.1' -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJmMzEwNzA0NC1iYjA1LTExZjAtYTZlMi1hZWVmN2RjNDBlNjYiLCJ1c2VybmFtZSI6ImFkbWluIiwiaWF0IjoxNzYyNTAwNzMzLCJleHAiOjE3NjUwOTI3MzN9.pZejD-sAGDMXW9cgGYnS9ReqG-TXFFFnyQZeMMY_2cQ' 'http://localhost:8083/api/v1/orders/d5a441bc-94f6-4695-a30e-4bfdb45d7223/pay'
1380+
curl --location --request POST 'http://localhost:8083/api/v1/orders/d08d8383-57c1-49c6-9a6a-b3920a46b43d/pay' \
1381+
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI3ZWJmZDZmMS02MDFmLTRmYzItYjc1Yy1iNWJkNjhlM2M5N2IiLCJ1c2VybmFtZSI6ImFkbWlubmV3IiwiaWF0IjoxNzY1MzA1NzQ0LCJleHAiOjE3Njc4OTc3NDR9.4pGTa6FgCzZRXYl_0cMpDGc_2XO1GxBlrTlnB7QAhaU'
13791382
```
13801383

13811384
**Step 2: Once you provide the input, you will see a response. This means we are able to reach your application and are now ready to generate tests. We’re just performing a validation before generating the test cases.**
13821385

1383-
<img src="https://keploy-devrel.s3.us-west-2.amazonaws.com/keploy_api_testing_3.png" alt="Sample Keploy Record Microservices" />
1386+
<img src="https://keploy-devrel.s3.us-west-2.amazonaws.com/keploy_initial_curl_validate.png" alt="Sample Keploy Record Microservices" />
13841387

13851388
**Step 3: Next, it’s time to provide the input — such as cURL commands, Postman collections, or an OpenAPI schema. Remember, the more input or content you provide, the better your test cases will be. For this demo, we’ll use Postman collections and cURL commands.**
13861389

@@ -2353,7 +2356,7 @@ code={`
23532356
23542357
/>
23552358
2356-
Paste the collections in the postman collections section.
2359+
_Paste the collections in the postman collections section._
23572360
23582361
<img src="https://keploy-devrel.s3.us-west-2.amazonaws.com/keploy_api_testing_4.png" alt="Sample Keploy Record Microservices" />
23592362
@@ -2495,11 +2498,261 @@ curl --request GET \
24952498
}
24962499
/>
24972500
2498-
Paste the cURL commands in the cURL section.
2501+
_Paste the cURL commands in the cURL section._
24992502
25002503
<img src="https://keploy-devrel.s3.us-west-2.amazonaws.com/keploy_api_testing_5.png" alt="Sample Keploy Record Microservices" />
25012504
2502-
**Step 4: Before generating the test, review and confirm the generation settings. In this example, the port has been changed to 8083, meaning the application gateway runs on 8083 to access all the services.**
2505+
**Also copy the openapi schema for the order service**
2506+
2507+
<CollapsibleCode
2508+
language="curl"
2509+
previewLines={10}
2510+
code={`
2511+
2512+
openapi: 3.1.0
2513+
info:
2514+
title: Order Service API
2515+
version: 1.0.0
2516+
components:
2517+
securitySchemes:
2518+
bearerAuth:
2519+
type: http
2520+
scheme: bearer
2521+
bearerFormat: JWT
2522+
security:
2523+
2524+
- bearerAuth: []
2525+
paths:
2526+
/api/v1/orders:
2527+
post:
2528+
summary: Create order
2529+
parameters: - in: header
2530+
name: Idempotency-Key
2531+
required: false
2532+
schema:
2533+
type: string
2534+
maxLength: 64
2535+
description: Prevent duplicate order creation. If provided, repeated requests return the same order.
2536+
requestBody:
2537+
required: true
2538+
content:
2539+
application/json:
2540+
schema:
2541+
type: object
2542+
required: - userId - items
2543+
properties:
2544+
userId:
2545+
type: string
2546+
items:
2547+
type: array
2548+
items:
2549+
type: object
2550+
required: - productId - quantity
2551+
properties:
2552+
productId:
2553+
type: string
2554+
quantity:
2555+
type: integer
2556+
minimum: 1
2557+
shippingAddressId:
2558+
type: string
2559+
nullable: true
2560+
responses:
2561+
'201':
2562+
description: Created
2563+
content:
2564+
application/json:
2565+
schema:
2566+
type: object
2567+
properties:
2568+
id:
2569+
type: string
2570+
status:
2571+
type: string
2572+
enum: [PENDING, PAID, CANCELLED]
2573+
'200':
2574+
description: Returned existing order for idempotent request
2575+
'400':
2576+
description: Bad request
2577+
'503':
2578+
description: Dependency unavailable
2579+
get:
2580+
summary: List orders
2581+
parameters: - in: query
2582+
name: userId
2583+
schema:
2584+
type: string - in: query
2585+
name: status
2586+
schema:
2587+
type: string
2588+
enum: [PENDING, PAID, CANCELLED] - in: query
2589+
name: limit
2590+
schema:
2591+
type: integer
2592+
minimum: 1
2593+
maximum: 100
2594+
default: 20 - in: query
2595+
name: cursor
2596+
schema:
2597+
type: string
2598+
responses:
2599+
'200':
2600+
description: OK
2601+
content:
2602+
application/json:
2603+
schema:
2604+
type: object
2605+
properties:
2606+
orders:
2607+
type: array
2608+
items:
2609+
type: object
2610+
properties:
2611+
id:
2612+
type: string
2613+
user_id:
2614+
type: string
2615+
status:
2616+
type: string
2617+
total_amount:
2618+
type: number
2619+
created_at:
2620+
type: string
2621+
format: date-time
2622+
nextCursor:
2623+
type: string
2624+
nullable: true
2625+
/api/v1/orders/{orderId}:
2626+
get:
2627+
summary: Get order by ID
2628+
parameters: - in: path
2629+
name: orderId
2630+
required: true
2631+
schema:
2632+
type: string
2633+
responses:
2634+
'200':
2635+
description: OK
2636+
content:
2637+
application/json:
2638+
schema:
2639+
type: object
2640+
properties:
2641+
id:
2642+
type: string
2643+
user_id:
2644+
type: string
2645+
status:
2646+
type: string
2647+
total_amount:
2648+
type: number
2649+
shipping_address_id:
2650+
type: string
2651+
nullable: true
2652+
created_at:
2653+
type: string
2654+
format: date-time
2655+
updated_at:
2656+
type: string
2657+
format: date-time
2658+
items:
2659+
type: array
2660+
items:
2661+
type: object
2662+
properties:
2663+
product_id:
2664+
type: string
2665+
quantity:
2666+
type: integer
2667+
price:
2668+
type: number
2669+
'404':
2670+
description: Not found
2671+
/api/v1/orders/{orderId}/details:
2672+
get:
2673+
summary: Get order by ID with enriched user and product details
2674+
parameters: - in: path
2675+
name: orderId
2676+
required: true
2677+
schema:
2678+
type: string
2679+
responses:
2680+
'200':
2681+
description: OK
2682+
content:
2683+
application/json:
2684+
schema:
2685+
type: object
2686+
properties:
2687+
id: { type: string }
2688+
status: { type: string }
2689+
total_amount: { type: number }
2690+
created_at: { type: string, format: date-time }
2691+
updated_at: { type: string, format: date-time }
2692+
userId: { type: string }
2693+
shippingAddressId: { type: string, nullable: true }
2694+
shippingAddress:
2695+
type: object
2696+
nullable: true
2697+
user:
2698+
type: object
2699+
nullable: true
2700+
items:
2701+
type: array
2702+
items:
2703+
type: object
2704+
properties:
2705+
productId: { type: string }
2706+
quantity: { type: integer }
2707+
product:
2708+
type: object
2709+
nullable: true
2710+
/api/v1/orders/{orderId}/cancel:
2711+
post:
2712+
summary: Cancel order
2713+
parameters: - in: path
2714+
name: orderId
2715+
required: true
2716+
schema:
2717+
type: string
2718+
responses:
2719+
'200':
2720+
description: Cancelled
2721+
'404':
2722+
description: Not found
2723+
'409':
2724+
description: Conflict
2725+
/api/v1/orders/{orderId}/pay:
2726+
post:
2727+
summary: Mark order paid
2728+
parameters: - in: path
2729+
name: orderId
2730+
required: true
2731+
schema:
2732+
type: string
2733+
responses:
2734+
'200':
2735+
description: Paid
2736+
'404':
2737+
description: Not found
2738+
'409':
2739+
description: Conflict
2740+
/health:
2741+
get:
2742+
summary: Health check
2743+
security: []
2744+
responses:
2745+
'200':
2746+
description: OK
2747+
2748+
`}
2749+
/>
2750+
2751+
_Also Paste the OpenAPI schema into the Schema Document section. Once completed, you will be able to view the schema coverage._
2752+
2753+
<img src="https://keploy-devrel.s3.us-west-2.amazonaws.com/keploy_microservices_schema_Coverage.png" alt="Sample Keploy Record Microservices" />
2754+
2755+
**Step 4: After providing the OpenAPI schema, cURL commands, and Postman collection, click the Generate API Tests button. Then, review and confirm the generation settings. In this example, the port is changed to 8083, which means the application gateway will run on port 8083 to access all services.**
25032756
25042757
<img src="https://keploy-devrel.s3.us-west-2.amazonaws.com/keploy_api_testing_6.png" alt="Sample Keploy Record Microservices" />
25052758

0 commit comments

Comments
 (0)