Apache camel 从驼峰生成的招摇定义中抑制驼峰特定属性
我正在使用camel-swagger生成我的服务的API定义。请在下面找到生成的招摇定义-Apache camel 从驼峰生成的招摇定义中抑制驼峰特定属性,apache-camel,swagger,aws-api-gateway,Apache Camel,Swagger,Aws Api Gateway,我正在使用camel-swagger生成我的服务的API定义。请在下面找到生成的招摇定义- { "swagger" : "2.0", "info" : { "description" : "api.description", "version" : "1.0", "title" : "api.title", "termsOfService" : "api.termsOfService", "contact" : { "name" : "
{
"swagger" : "2.0",
"info" : {
"description" : "api.description",
"version" : "1.0",
"title" : "api.title",
"termsOfService" : "api.termsOfService",
"contact" : {
"name" : "api.contact.name",
"url" : "http://api.contact.url",
"email" : "api@demo.com"
},
"license" : {
"name" : "api.license.name",
"url" : "http://api.license.url"
}
},
"host" : "0.0.0.0:13000",
"basePath" : "/airportinfo-service/1.0",
"tags" : [ {
"name" : "airports"
} ],
"schemes" : [ "http" ],
"paths" : {
"/airports" : {
"get" : {
"tags" : [ "airports" ],
"parameters" : [ ],
"responses" : {
"200" : {
"description" : "Output type",
"schema" : {
"$ref" : "#/definitions/Airports"
}
}
},
"x-camelContextId" : "airportinfo-service",
"x-routeId" : "getAirports"
}
},
"/airports/{id}" : {
"get" : {
"tags" : [ "airports" ],
"parameters" : [ {
"name" : "id",
"in" : "path",
"description" : "",
"required" : true,
"type" : "string"
} ],
"responses" : {
"200" : {
"description" : "Output type",
"schema" : {
"$ref" : "#/definitions/Airport"
}
}
},
"x-camelContextId" : "airportinfo-service",
"x-routeId" : "getAirport"
}
},
"/airports/health" : {
"get" : {
"tags" : [ "airports" ],
"parameters" : [ ],
"responses" : {
"200" : {
"description" : "Output type",
"schema" : {
"type" : "string",
"format" : "java.lang.String"
}
}
},
"x-camelContextId" : "airportinfo-service",
"x-routeId" : "health"
}
}
},
"definitions" : {
"Airport" : {
"type" : "object",
"properties" : {
"id" : {
"type" : "integer",
"format" : "int64"
},
"airportIataCode" : {
"type" : "string"
},
"airportName" : {
"type" : "string"
},
"airportStatus" : {
"type" : "string"
},
"airportLatitude" : {
"type" : "number",
"format" : "double"
},
"airportLongitude" : {
"type" : "number",
"format" : "double"
},
"airportUrl" : {
"type" : "string"
},
"cityId" : {
"type" : "integer",
"format" : "int64"
},
"cityIataCode" : {
"type" : "string"
},
"cityName" : {
"type" : "string"
},
"cityLatitude" : {
"type" : "number",
"format" : "double"
},
"cityLongitude" : {
"type" : "number",
"format" : "double"
},
"cityStatus" : {
"type" : "string"
},
"cityCategory" : {
"type" : "string"
},
"countryId" : {
"type" : "integer",
"format" : "int64"
},
"countryIataCode" : {
"type" : "string"
},
"countryName" : {
"type" : "string"
},
"region" : {
"type" : "string"
}
},
"x-className" : {
"type" : "string",
"format" : "demo.service.composite.airportinfo.datatypes.Airport"
}
},
"Airports" : {
"type" : "object",
"properties" : {
"size" : {
"type" : "integer",
"format" : "int32"
},
"airports" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/Airport"
}
}
},
"x-className" : {
"type" : "string",
"format" : "demo.service.composite.airportinfo.datatypes.Airports"
}
}
}
}
生成上述API定义的代码是-
restConfiguration()
.component("{{server.component}}")
.host("{{server.host}}")
.port("{{server.port}}")
.bindingMode(RestBindingMode.json)
.dataFormatProperty("prettyPrint", "true")
.contextPath("/{{service.name}}/{{service.version}}")
.apiContextPath( "/" )
.apiProperty("api.title", "{{api.title}}")
.apiProperty("api.version", "{{service.version}}")
.apiProperty("api.description", "{{api.description}}")
.apiProperty("api.termsOfService", "{{api.termsOfService}}")
.apiProperty("api.contact.name", "{{api.contact.name}}")
.apiProperty("api.contact.email", "{{api.contact.email}}")
.apiProperty("api.contact.url", "{{api.contact.url}}")
.apiProperty("api.license.name", "{{api.license.name}}")
.apiProperty("api.license.url", "{{api.license.url}}")
.apiProperty("apiContextIdListing", "{{apiContextIdListing}}")
.apiProperty("apiContextIdPattern", "{{apiContextIdPattern}}");
rest("/airports")
.get()
.id("getAirports")
.outType(Airports.class)
.to("direct:getAirports")
.get("/{id}")
.id("getAirport")
.outType(Airport.class)
.to("direct:getAirport")
.get("/health")
.id("health")
.outType(String.class)
.to("direct:health");
现在,我想在AWSAPI网关中导入此定义。但是,由于上面给出的API定义中的以下部分,这一点不被接受-
"x-className" : {
"type" : "string",
"format" : "demo.service.composite.airportinfo.datatypes.Airport"
}
"x-className" : {
"type" : "string",
"format" : "demo.service.composite.airportinfo.datatypes.Airports"
}
"x-className" : {
"type" : "string",
"format" : "demo.service.composite.airportinfo.datatypes.Airport"
}
"x-className" : {
"type" : "string",
"format" : "demo.service.composite.airportinfo.datatypes.Airports"
}
"schema" : {
"type" : "string",
"format" : "java.lang.String"
}
与
谢谢。不,这是不可能的,它们总是包括在内 这些类型都是扩展,例如它们以规范中的
x-
开头:
我在下一个版本中记录了对此的支持:
我们还修复了响应中的原语类型,使其不使用格式:不,这是不可能的,它们总是包含在内 这些类型都是扩展,例如它们以规范中的
x-
开头:
我在下一个版本中记录了对此的支持:
我们还修复了响应中的原语类型,使其不使用该格式: