Skip to content

Commit f3e1c90

Browse files
committed
"hide" no endpoint parameters (#302)
1 parent faf5937 commit f3e1c90

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

openapi-processor-core/src/main/kotlin/io/openapiprocessor/core/converter/ApiConverter.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,13 @@ class ApiConverter(
103103
private fun createUnreferencedSchemas(api: OpenApi, target: Api) {
104104
api.getSchemas().forEach { (name: String, schema: Schema) ->
105105
val info = SchemaInfo(
106-
// todo required but unavailable for unreferenced schemas, create NullEndpoint?
107-
SchemaInfo.Endpoint("none", HttpMethod.HEAD),
106+
SchemaInfo.NoEndpoint(),
108107
name,
109108
"",
110109
schema,
111110
api.getRefResolver(),
112111
"components/schemas",
113-
// no marker interfaces,
112+
// no marker interfaces
114113
)
115114

116115
convertDataType(info, target.getDataTypes())

openapi-processor-core/src/main/kotlin/io/openapiprocessor/core/converter/SchemaInfo.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ open class SchemaInfo(
6060

6161
): MappingSchema {
6262

63-
class Endpoint(val path: String, val method: HttpMethod)
63+
open class Endpoint(val path: String, val method: HttpMethod)
64+
class NoEndpoint(): Endpoint("", HttpMethod.GET)
6465

6566
/**
6667
* if this is a $ref it indicates that the name of this SchemaInfo should be propagated to its

0 commit comments

Comments
 (0)