feat(import): preserve supported HTTP contracts

This commit is contained in:
bsodfather committed 2026-09-13 03:30:31 +03:00
1 parent 083974c27f
commit f8ee7c9bfe
87 files changed
+7496 -534

No files matched your search

@@ -296,6 +296,9 @@ fn destructive_delete_operation() -> Operation<Schema, MappingSet> {
method: HttpMethod::Delete,
path_template: "/orders/{order_id}".to_owned(),
static_headers: BTreeMap::new(),
request_contract: None,
response_contract: Vec::new(),
multipart_field_mime_types: BTreeMap::new(),
}),
input_schema: object_schema(BTreeMap::from([("order_id".to_owned(), string_schema())])),
output_schema: object_schema(BTreeMap::from([("deleted".to_owned(), bool_schema())])),
@@ -353,6 +356,7 @@ fn destructive_delete_operation() -> Operation<Schema, MappingSet> {
fn object_schema(fields: BTreeMap<String, Schema>) -> Schema {
Schema {
kind: SchemaKind::Object,
format: None,
description: None,
required: true,
nullable: false,
@@ -367,6 +371,7 @@ fn object_schema(fields: BTreeMap<String, Schema>) -> Schema {
fn string_schema() -> Schema {
Schema {
kind: SchemaKind::String,
format: None,
description: None,
required: true,
nullable: false,
@@ -381,6 +386,7 @@ fn string_schema() -> Schema {
fn bool_schema() -> Schema {
Schema {
kind: SchemaKind::Boolean,
format: None,
description: None,
required: true,
nullable: false,
@@ -310,6 +310,9 @@ fn idempotent_post_operation() -> Operation<Schema, MappingSet> {
method: HttpMethod::Post,
path_template: "/orders".to_owned(),
static_headers: BTreeMap::new(),
request_contract: None,
response_contract: Vec::new(),
multipart_field_mime_types: BTreeMap::new(),
}),
input_schema: object_schema(BTreeMap::from([("request_id".to_owned(), string_schema())])),
output_schema: object_schema(BTreeMap::from([("result".to_owned(), string_schema())])),
@@ -359,6 +362,7 @@ fn idempotent_post_operation() -> Operation<Schema, MappingSet> {
fn object_schema(fields: BTreeMap<String, Schema>) -> Schema {
Schema {
kind: SchemaKind::Object,
format: None,
description: None,
required: true,
nullable: false,
@@ -373,6 +377,7 @@ fn object_schema(fields: BTreeMap<String, Schema>) -> Schema {
fn string_schema() -> Schema {
Schema {
kind: SchemaKind::String,
format: None,
description: None,
required: true,
nullable: false,
@@ -72,9 +72,13 @@ fn no_input_get_operation() -> Operation<Schema, MappingSet> {
method: HttpMethod::Get,
path_template: "/health".to_owned(),
static_headers: BTreeMap::new(),
request_contract: None,
response_contract: Vec::new(),
multipart_field_mime_types: BTreeMap::new(),
}),
input_schema: Schema {
kind: SchemaKind::Object,
format: None,
description: None,
required: true,
nullable: false,
@@ -86,6 +90,7 @@ fn no_input_get_operation() -> Operation<Schema, MappingSet> {
},
output_schema: Schema {
kind: SchemaKind::Object,
format: None,
description: None,
required: true,
nullable: false,