From d8112498fbc24d938d613f1ed66c5c727939b88f Mon Sep 17 00:00:00 2001 From: abdelfetah18 Date: Fri, 29 Nov 2024 21:53:57 +0100 Subject: [PATCH] Ensure consistent parameter order across all methods --- .../openapi/validation/OpenAPIComparator.scala | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/openapi-model/src/main/scala/sttp/apispec/openapi/validation/OpenAPIComparator.scala b/openapi-model/src/main/scala/sttp/apispec/openapi/validation/OpenAPIComparator.scala index ee98a39..c399a34 100644 --- a/openapi-model/src/main/scala/sttp/apispec/openapi/validation/OpenAPIComparator.scala +++ b/openapi-model/src/main/scala/sttp/apispec/openapi/validation/OpenAPIComparator.scala @@ -64,8 +64,8 @@ class OpenAPIComparator( private def checkOperation( httpMethod: String, - readerOperation: Operation, - writerOperation: Operation + writerOperation: Operation, + readerOperation: Operation ): Option[IncompatibleOperation] = { val readerParameters = getOperationParameters(readerOperation) val writerParameters = getOperationParameters(writerOperation) @@ -104,7 +104,7 @@ class OpenAPIComparator( Some(IncompatibleOperation(httpMethod, issues)) } - private def checkParameter(readerParameter: Parameter, writerParameter: Parameter): Option[IncompatibleParameter] = { + private def checkParameter(writerParameter: Parameter, readerParameter: Parameter): Option[IncompatibleParameter] = { val isCompatibleStyle = readerParameter.style == writerParameter.style val isCompatibleExplode = readerParameter.explode == writerParameter.explode val isCompatibleAllowEmptyValue = readerParameter.allowEmptyValue == writerParameter.allowEmptyValue @@ -125,8 +125,8 @@ class OpenAPIComparator( } private def checkContent( - readerContent: ListMap[String, MediaType], - writerContent: ListMap[String, MediaType] + writerContent: ListMap[String, MediaType], + readerContent: ListMap[String, MediaType] ): Option[IncompatibleContent] = { val issues = writerContent.flatMap { case (writerMediaType, writerMediaTypeDescription) => val readerMediaTypeDescription = readerContent.get(writerMediaType) @@ -157,8 +157,8 @@ class OpenAPIComparator( } private def checkSchema( - readerSchema: Option[SchemaLike], - writerSchema: Option[SchemaLike] + writerSchema: Option[SchemaLike], + readerSchema: Option[SchemaLike] ): Option[OpenAPICompatibilityIssue] = { (readerSchema, writerSchema) match { case (Some(readerSchema: Schema), Some(writerSchema: Schema)) =>