Wave 5: Schemas command, sync command, network policy, test fixtures (bd-x15, bd-3f4, bd-1cv, bd-lx6)
- Implement schemas command with list/show modes, regex filtering, ref expansion - Implement sync command with conditional fetch, content hash diffing, dry-run - Add NetworkPolicy enum (Auto/Offline/OnlineOnly) with env var + CLI flag resolution - Integrate network policy into AsyncHttpClient and fetch command - Create test fixtures (petstore.json/yaml, minimal.json) and integration test helpers - Fix clippy lints: derivable_impls, len_zero, borrow-after-move, deprecated API - 192 tests passing (179 unit + 13 integration), all quality gates green
This commit is contained in:
92
tests/fixtures/minimal.json
vendored
Normal file
92
tests/fixtures/minimal.json
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
{
|
||||
"openapi": "3.0.3",
|
||||
"info": {
|
||||
"title": "Minimal API",
|
||||
"version": "0.1.0"
|
||||
},
|
||||
"paths": {
|
||||
"/items": {
|
||||
"get": {
|
||||
"operationId": "listItems",
|
||||
"summary": "List items",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "A list of items",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": { "$ref": "#/components/schemas/ItemList" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"post": {
|
||||
"operationId": "createItem",
|
||||
"summary": "Create item",
|
||||
"requestBody": {
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": { "$ref": "#/components/schemas/Item" }
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": "Item created",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": { "$ref": "#/components/schemas/Item" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/items/{id}": {
|
||||
"get": {
|
||||
"operationId": "getItem",
|
||||
"summary": "Get item by ID",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "A single item",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": { "$ref": "#/components/schemas/Item" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"components": {
|
||||
"schemas": {
|
||||
"Item": {
|
||||
"type": "object",
|
||||
"required": ["id", "name"],
|
||||
"properties": {
|
||||
"id": { "type": "integer", "format": "int64" },
|
||||
"name": { "type": "string" }
|
||||
}
|
||||
},
|
||||
"ItemList": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"items": {
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/components/schemas/Item" }
|
||||
},
|
||||
"total": { "type": "integer" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
144
tests/fixtures/petstore.yaml
vendored
Normal file
144
tests/fixtures/petstore.yaml
vendored
Normal file
@@ -0,0 +1,144 @@
|
||||
openapi: "3.0.3"
|
||||
info:
|
||||
title: Petstore
|
||||
version: "1.0.0"
|
||||
description: A minimal Petstore API for testing.
|
||||
security:
|
||||
- api_key: []
|
||||
tags:
|
||||
- name: pets
|
||||
description: Pet operations
|
||||
- name: store
|
||||
description: Store operations
|
||||
paths:
|
||||
/pets:
|
||||
get:
|
||||
operationId: listPets
|
||||
summary: List all pets
|
||||
tags:
|
||||
- pets
|
||||
parameters:
|
||||
- name: limit
|
||||
in: query
|
||||
required: false
|
||||
description: Maximum number of items to return
|
||||
- name: offset
|
||||
in: query
|
||||
required: false
|
||||
description: Pagination offset
|
||||
responses:
|
||||
"200":
|
||||
description: A list of pets
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/Pet"
|
||||
post:
|
||||
operationId: createPet
|
||||
summary: Create a pet
|
||||
tags:
|
||||
- pets
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/NewPet"
|
||||
responses:
|
||||
"201":
|
||||
description: Pet created
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Pet"
|
||||
/pets/{petId}:
|
||||
parameters:
|
||||
- name: petId
|
||||
in: path
|
||||
required: true
|
||||
description: The ID of the pet
|
||||
get:
|
||||
operationId: showPetById
|
||||
summary: Get a pet by ID
|
||||
tags:
|
||||
- pets
|
||||
responses:
|
||||
"200":
|
||||
description: A single pet
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Pet"
|
||||
"404":
|
||||
description: Pet not found
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Error"
|
||||
delete:
|
||||
operationId: deletePet
|
||||
summary: Delete a pet
|
||||
tags:
|
||||
- pets
|
||||
deprecated: true
|
||||
responses:
|
||||
"204":
|
||||
description: Pet deleted
|
||||
/store/inventory:
|
||||
get:
|
||||
operationId: getInventory
|
||||
summary: Get store inventory
|
||||
tags:
|
||||
- store
|
||||
security: []
|
||||
responses:
|
||||
"200":
|
||||
description: Inventory counts
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
additionalProperties:
|
||||
type: integer
|
||||
components:
|
||||
schemas:
|
||||
Pet:
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
- name
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
format: int64
|
||||
name:
|
||||
type: string
|
||||
tag:
|
||||
type: string
|
||||
NewPet:
|
||||
type: object
|
||||
required:
|
||||
- name
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
tag:
|
||||
type: string
|
||||
Error:
|
||||
type: object
|
||||
required:
|
||||
- code
|
||||
- message
|
||||
properties:
|
||||
code:
|
||||
type: integer
|
||||
format: int32
|
||||
message:
|
||||
type: string
|
||||
securitySchemes:
|
||||
api_key:
|
||||
type: apiKey
|
||||
name: X-API-Key
|
||||
in: header
|
||||
Reference in New Issue
Block a user