Repository: swagger-api/swagger-parser
Pull request #974 (2019-01-04 20:55:21)

fixes issue #973
Set correct integer value #973


Patch:
diff --git a/modules/swagger-parser-v3/src/main/java/io/swagger/v3/parser/util/SchemaTypeUtil.java b/modules/swagger-parser-v3/src/main/java/io/swagger/v3/parser/util/SchemaTypeUtil.java
index 85bbb690..c0651e5d 100644
--- a/modules/swagger-parser-v3/src/main/java/io/swagger/v3/parser/util/SchemaTypeUtil.java
+++ b/modules/swagger-parser-v3/src/main/java/io/swagger/v3/parser/util/SchemaTypeUtil.java
@@ -56,26 +56,25 @@ public class SchemaTypeUtil {
     public static Schema createSchema(String type, String format) {
 
         if(INTEGER_TYPE.equals(type)) {
-            if(INTEGER64_FORMAT.equals(format)) {
-                return new IntegerSchema().format(INTEGER64_FORMAT);
-            }
-            else {
-                return new IntegerSchema();
+            if(StringUtils.isBlank(format)){
+                return new IntegerSchema().format(null);
+            }else {
+                return new IntegerSchema().format(format);
             }
         }
         else if(NUMBER_TYPE.equals(type)) {
-            if(FLOAT_FORMAT.equals(format)) {
-                return new NumberSchema().format(FLOAT_FORMAT);
-            }
-            else if(DOUBLE_FORMAT.equals(format)) {
-                return new NumberSchema().format(DOUBLE_FORMAT);
-            }
-            else {
+            if (StringUtils.isBlank(format)){
                 return new NumberSchema();
+            } else {
+                return new NumberSchema().format(format);
             }
         }
         else if(BOOLEAN_TYPE.equals(type)) {
-            return new BooleanSchema();
+            if (StringUtils.isBlank(format)){
+                return new BooleanSchema();
+            } else {
+                return new BooleanSchema().format(format);
+            }
         }
         else if(STRING_TYPE.equals(type)) {
             if(BYTE_FORMAT.equals(format)) {
@@ -100,7 +99,11 @@ public class SchemaTypeUtil {
                 return new UUIDSchema();
             }
             else {
-                return new StringSchema();
+                if (StringUtils.isBlank(format)){
+                    return new StringSchema().format(null);
+                }else {
+                    return new StringSchema().format(format);
+                }
             }
         }
         else if(OBJECT_TYPE.equals(type)) {


Test patch:
diff --git a/modules/swagger-parser-v3/src/test/java/io/swagger/v3/parser/test/OpenAPIV3ParserTest.java b/modules/swagger-parser-v3/src/test/java/io/swagger/v3/parser/test/OpenAPIV3ParserTest.java
index ca4e39c0..e6dfdf62 100644
--- a/modules/swagger-parser-v3/src/test/java/io/swagger/v3/parser/test/OpenAPIV3ParserTest.java
+++ b/modules/swagger-parser-v3/src/test/java/io/swagger/v3/parser/test/OpenAPIV3ParserTest.java
@@ -57,6 +57,19 @@ public class OpenAPIV3ParserTest {
     protected int serverPort = getDynamicPort();
     protected WireMockServer wireMockServer;
 
+    @Test
+    public void testIssueIntegerDefault() {
+        OpenAPIV3Parser parser = new OpenAPIV3Parser();
+        ParseOptions options = new ParseOptions();
+        options.setResolve(true);
+        final OpenAPI openAPI = parser.readLocation("integerDefault.yaml", null, options).getOpenAPI();
+        Assert.assertNotNull(openAPI);
+        Assert.assertFalse (((IntegerSchema) openAPI.getPaths().get("/fileUpload").getPost().getRequestBody().getContent().get("multipart/form-data").getSchema().getProperties().get("intMetadata")).getFormat() == "int32");
+        Assert.assertNull ( openAPI.getPaths().get("/mockResponses/primitiveDoubleResponse").getGet().getResponses().get("200").getContent().get("application/json").getSchema().getFormat());
+        Assert.assertNull ( openAPI.getPaths().get("/issue-125").getGet().getResponses().get("200").getContent().get("*/*").getSchema().getFormat());
+        Assert.assertNull (openAPI.getPaths().get("/primitiveBody/binary").getPost().getRequestBody().getContent().get("application/octet-stream").getSchema().getFormat());
+    }
+  
     @Test
     public void testIssue983() {
         OpenAPIV3Parser parser = new OpenAPIV3Parser();
@@ -66,10 +79,8 @@ public class OpenAPIV3ParserTest {
         Assert.assertNotNull(openAPI);
         Yaml.prettyPrint(openAPI);
         Assert.assertNotNull(openAPI.getComponents().getSchemas().get("InventoryId"));
-
     }
-
-
+  
     @Test
     public void testIssue913() {
         OpenAPIV3Parser parser = new OpenAPIV3Parser();
diff --git a/modules/swagger-parser-v3/src/test/resources/integerDefault.yaml b/modules/swagger-parser-v3/src/test/resources/integerDefault.yaml
new file mode 100644
index 00000000..584cb511
--- /dev/null
+++ b/modules/swagger-parser-v3/src/test/resources/integerDefault.yaml
@@ -0,0 +1,771 @@
+---
+openapi: 3.0
+info:
+  title: Test Service
+  description: description
+  termsOfService: terms
+  contact:
+    name: API Team
+    url: http://swagger.io
+    email: apiteam@swagger.io
+  license:
+    name: MIT
+    url: http://opensource.org/licenses/MIT
+  version: 0.0.0
+basePath: /api
+paths:
+  "/producesTest":
+    get:
+      parameters: []
+      responses:
+        '200':
+          description: it works
+          content:
+            application/json:
+              schema:
+                type: object
+                properties:
+                  name:
+                    type: string
+  "/fileUpload":
+    post:
+      x-swagger-router-controller: TestController
+      operationId: uploadFile
+      requestBody:
+        content:
+          multipart/form-data:
+            schema:
+              type: object
+              properties:
+                theFile:
+                  type: string
+                  format: binary
+                stringMetadata:
+                  type: string
+                intMetadata:
+                  type: integer
+      responses:
+        '200':
+          description: the stringMetadata passed in
+          content:
+            "*/*":
+              schema:
+                type: string
+  "/primitiveBody/inline":
+    post:
+      operationId: inlineRequiredBody
+      requestBody:
+        content:
+          "*/*":
+            schema:
+              type: object
+              properties:
+                name:
+                  type: string
+        required: true
+      responses:
+        '200':
+          description: ok!
+  "/primitiveBody/string":
+    post:
+      operationId: stringBody
+      requestBody:
+        content:
+          "*/*":
+            schema:
+              type: string
+        required: false
+      responses:
+        '200':
+          description: ok!
+  "/primitiveBody/integer":
+    post:
+      operationId: integerBody
+      requestBody:
+        content:
+          "*/*":
+            schema:
+              type: integer
+              format: int32
+        required: false
+      responses:
+        '200':
+          description: ok!
+  "/primitiveBody/binary":
+    post:
+      operationId: binaryBody
+      requestBody:
+        content:
+          application/octet-stream:
+            schema:
+              type: string
+
+        required: false
+      responses:
+        '200':
+          description: ok!
+          content:
+            application/octet-stream:
+              schema:
+                type: string
+
+  "/hidden":
+    get:
+      responses:
+        default:
+          description: ok
+  "/arrayInputTest":
+    get:
+      operationId: arrayInputTest
+      parameters:
+        - name: users
+          in: query
+          required: true
+          schema:
+            type: array
+            items:
+              type: string
+      responses:
+        '200':
+          description: success!
+  "/formTest":
+    post:
+      operationId: formTest
+      requestBody:
+        content:
+          x-www-form-urlencoded:
+            schema:
+              properties:
+                user:
+                  type: string
+      responses:
+        '200':
+          description: success!
+  "/mockResponses":
+    get:
+      parameters:
+        - name: user
+          in: query
+          required: true
+          schema:
+            type: string
+      responses:
+        '200':
+          description: success!
+  "/mockResponses/primitiveFloatResponse":
+    get:
+      parameters:
+        - name: user
+          in: query
+          schema:
+            type: string
+      responses:
+        '200':
+          description: success!
+          content:
+            application/json:
+              schema:
+                type: number
+
+  "/mockResponses/primitiveDoubleResponse":
+    get:
+      parameters:
+        - name: user
+          in: query
+          schema:
+            type: string
+      responses:
+        '200':
+          description: success!
+          content:
+            application/json:
+              schema:
+                type: number
+
+  "/mockResponses/primitiveStringResponse":
+    get:
+      parameters:
+        - name: user
+          in: query
+          schema:
+            type: string
+      responses:
+        '200':
+          description: success!
+          content:
+            application/json:
+              schema:
+                type: string
+  "/mockResponses/primitiveStringResponseWithExample":
+    get:
+      parameters:
+        - name: user
+          in: query
+          schema:
+            type: string
+      responses:
+        '200':
+          description: success!
+          content:
+            application/json:
+              schema:
+                type: string
+  "/mockResponses/responseWithExamples":
+    get:
+      responses:
+        '200':
+          description: success!
+  "/mockResponses/primitiveDateResponse":
+    get:
+      parameters:
+        - name: user
+          in: query
+          schema:
+            type: string
+      responses:
+        '200':
+          description: success!
+          content:
+            application/json:
+              schema:
+                type: string
+                format: date
+  "/mockResponses/primitiveDateTimeResponse":
+    get:
+      parameters:
+        - name: user
+          in: query
+          schema:
+            type: string
+      responses:
+        '200':
+          description: success!
+          content:
+            application/json:
+              schema:
+                type: string
+                format: date-time
+  "/mockResponses/primitiveBigDecimalResponse":
+    get:
+      parameters:
+        - name: user
+          in: query
+          schema:
+            type: string
+      responses:
+        '200':
+          description: success!
+          content:
+            application/json:
+              schema:
+                type: number
+  "/mockResponses/primitiveEmailResponse":
+    get:
+      parameters:
+        - name: user
+          in: query
+          schema:
+            type: string
+      responses:
+        '200':
+          description: success!
+          content:
+            application/json:
+              schema:
+                type: string
+                format: email
+  "/mockResponses/primitiveUUIDResponse":
+    get:
+      parameters:
+        - name: user
+          in: query
+          schema:
+            type: string
+      responses:
+        '200':
+          description: success!
+          content:
+            application/json:
+              schema:
+                type: string
+                format: uuid
+  "/mockResponses/primitiveMapResponse":
+    get:
+      parameters:
+        - name: user
+          in: query
+          schema:
+            type: string
+      responses:
+        '200':
+          description: success!
+          content:
+            application/json:
+              schema:
+                type: object
+                additionalProperties:
+                  type: string
+  "/mockResponses/complexResponse":
+    get:
+      parameters:
+        - name: user
+          in: query
+          schema:
+            type: string
+      responses:
+        '200':
+          description: success!
+          content:
+            application/json:
+              schema:
+                "$ref": "#/components/schemas/Address"
+  "/mockResponses/complexResponseWithExample":
+    get:
+      responses:
+        '200':
+          description: success!
+          content:
+            application/json:
+              schema:
+                "$ref": "#/components/schemas/User"
+  "/mockResponses/complexArrayResponse":
+    get:
+      parameters:
+        - name: user
+          in: query
+          schema:
+            type: string
+      responses:
+        '200':
+          description: success!
+          content:
+            application/json:
+              schema:
+                type: array
+  "/mockResponses/complexArrayResponseWithExample":
+    get:
+      parameters:
+        - name: user
+          in: query
+          schema:
+            type: string
+      responses:
+        '200':
+          description: success!
+          content:
+            application/json:
+              schema:
+                type: array
+  "/issue-125":
+    get:
+      responses:
+        '200':
+          description: int16
+          content:
+            "*/*":
+              schema:
+                type: integer
+               
+  "/issue-128":
+    get:
+      responses:
+        '303':
+          description: issue 128
+          content:
+            "*/*":
+              schema:
+                type: string
+                format: url
+  "/issue-130":
+    get:
+      responses:
+        '200':
+          description: issue 130
+          content:
+            "*/*":
+              schema:
+                type: object
+                properties:
+                  aStringArray:
+                    type: array
+                  anIntegerArray:
+                    type: array
+                description: an object with array properties
+  "/issue-132":
+    get:
+      responses:
+        '303':
+          description: issue 132
+  "/issue-132.2":
+    get:
+      responses:
+        '303':
+          description: issue 133, alternate example
+  "/form":
+    post:
+      operationId: postFormData
+      requestBody:
+        content: {}
+      responses:
+        '200':
+          description: ok
+  "/goodbye":
+    get:
+      operationId: goodbye
+      parameters:
+        - name: happy
+          in: query
+          required: true
+          schema:
+            type: array
+            items:
+              type: string
+      responses:
+        '200':
+          description: success!
+          content:
+            application/json:
+              schema:
+                "$ref": "#/components/schemas/User"
+  "/hello":
+    get:
+      operationId: testMe
+      parameters:
+        - name: limit
+          in: query
+          required: true
+          schema:
+            minimum: 0
+            type: integer
+            format: int32
+        - name: min
+          in: query
+          required: true
+          schema:
+            minimum: 10
+            type: integer
+            format: int32
+      responses:
+        '200':
+          description: fun!
+          content:
+            application/json:
+              schema:
+                type: string
+  "/withModelArray/{id}":
+    post:
+      operationId: withModelArray
+      parameters:
+        - name: id
+          in: path
+          required: true
+          schema:
+            type: string
+      requestBody:
+        content:
+          "*/*":
+            schema:
+              type: array
+        required: true
+      responses:
+        '200':
+          description: success!
+          content:
+            "*/*":
+              schema:
+                "$ref": "#/components/schemas/Animal"
+  "/withModel/{id}":
+    get:
+      operationId: withModel
+      parameters:
+        - name: id
+          in: path
+          required: true
+          schema:
+            type: string
+      responses:
+        '200':
+          description: success!
+          content:
+            "*/*":
+              schema:
+                "$ref": "#/components/schemas/Animal"
+    post:
+      operationId: withModel
+      parameters:
+        - name: id
+          in: path
+          required: true
+          schema:
+            type: string
+      requestBody:
+        content:
+          "*/*":
+            schema:
+              "$ref": "#/components/schemas/Address"
+        required: false
+      responses:
+        '200':
+          description: success!
+          content:
+            "*/*":
+              schema:
+                "$ref": "#/components/schemas/Address"
+  "/withInvalidComposedModel":
+    post:
+      operationId: withInvalidComposedModel
+      requestBody:
+        content:
+          "*/*":
+            schema:
+              "$ref": "#/components/schemas/ExtendedAddress"
+        required: false
+      responses:
+        '200':
+          description: success!
+  "/withValidComposedModel":
+    post:
+      operationId: withValidComposedModel
+      requestBody:
+        content:
+          "*/*":
+            schema:
+              "$ref": "#/components/schemas/ExtendedAddress"
+        required: false
+      responses:
+        '200':
+          description: success!
+  "/withInvalidComposedModelArray":
+    post:
+      operationId: withInvalidComposedModelArray
+      requestBody:
+        content:
+          "*/*":
+            schema:
+              type: array
+        required: false
+      responses:
+        '200':
+          description: success!
+  "/unmappedWithModel/{id}":
+    post:
+      operationId: unmappedWithModelInput
+      parameters:
+        - name: id
+          in: path
+          required: true
+          schema:
+            type: string
+      requestBody:
+        content:
+          "*/*":
+            schema:
+              "$ref": "#/components/schemas/Address"
+        required: false
+      responses:
+        '200':
+          description: success!
+          content:
+            "*/*":
+              schema:
+                "$ref": "#/components/schemas/Address"
+  "/mappedWithDefinedModel/{id}":
+    post:
+      operationId: mappedWithDefinedModel
+      parameters:
+        - name: id
+          in: path
+          required: true
+          schema:
+            type: string
+      requestBody:
+        content:
+          "*/*":
+            schema:
+              "$ref": "#/components/schemas/Dog"
+        required: false
+      responses:
+        '200':
+          description: success!
+          content:
+            "*/*":
+              schema:
+                "$ref": "#/components/schemas/Dog"
+  "/unmappedWithUndefinedModel/{id}":
+    post:
+      operationId: unmappedWithUndefinedModel
+      parameters:
+        - name: id
+          in: path
+          required: true
+          schema:
+            type: string
+      requestBody:
+        content:
+          "*/*":
+            schema:
+              "$ref": "#/components/schemas/UnmappedModel"
+        required: false
+      responses:
+        '200':
+          description: success!
+  "/withPath/{id}":
+    get:
+      operationId: withPath
+      parameters:
+        - name: id
+          in: path
+          required: true
+          schema:
+            type: string
+      responses:
+        '200':
+          description: success!
+          content:
+            "*/*":
+              schema:
+                "$ref": "#/components/schemas/User"
+  "/withDate/{date}":
+    get:
+      operationId: withDateTime
+      parameters:
+        - name: date
+          in: path
+          required: true
+          schema:
+            type: string
+            format: date-time
+      responses:
+        '200':
+          description: success!
+          content:
+            "*/*":
+              schema:
+                "$ref": "#/components/schemas/User"
+  "/withIntegerEnum/{stage}":
+    get:
+      operationId: withDateTime
+      parameters:
+        - name: stage
+          in: path
+          required: true
+          schema:
+            type: integer
+            format: int32
+            enum:
+              - 1
+              - 2
+              - 3
+      responses:
+        '200':
+          description: success!
+          content:
+            "*/*":
+              schema:
+                "$ref": "#/components/schemas/User"
+  "/overloaded":
+    get:
+      operationId: overloadedResponse
+      parameters:
+        - name: arg1
+          in: query
+          schema:
+            type: string
+      responses:
+        '200':
+          description: success!
+          content:
+            "*/*":
+              schema:
+                "$ref": "#/components/schemas/User"
+  "/throwApiException":
+    get:
+      operationId: throwApiException
+      responses:
+        '200':
+          description: success!
+  "/throwApiExceptionAsCause":
+    get:
+      operationId: throwApiExceptionAsCause
+      responses:
+        '200':
+          description: success!
+  "/throwNonApiException":
+    get:
+      operationId: throwNonApiException
+      responses:
+        '200':
+          description: success!
+  "/returnNonRfc2616Status":
+    get:
+      operationId: returnNonRfc2616Status
+      responses:
+        '200':
+          description: success!
+  "/responseHeaders":
+    get:
+      operationId: returnWithResponseHeaders
+      responses:
+        '200':
+          description: success
+components:
+  schemas:
+    Water:
+      properties:
+        clear:
+          type: boolean
+        name:
+          type: string
+        prices:
+          type: array
+        id:
+          type: string
+          format: uuid
+    ExtendedAddress: {}
+    User:
+      properties:
+        id:
+          type: integer
+          format: int64
+        name:
+          type: string
+      description: the name!
+    Address:
+      required:
+        - street
+      type: object
+      properties:
+        street:
+          type: string
+        city:
+          type: string
+        state:
+          type: string
+        zip:
+          type: string
+    UnmappedModel:
+      properties:
+        id:
+          type: integer
+          format: int64
+        name:
+          type: string
+    Animal:
+      properties:
+        id:
+          type: integer
+          format: int64
+        name:
+          type: string
+        address:
+          "$ref": "#/components/schemas/Address"
+      description: the name!
+    Dog:
+      properties:
+        id:
+          type: integer
+          format: int64
+        name:
+          type: string
+        dogType:
+          type: string
\ No newline at end of file
diff --git a/modules/swagger-parser/src/test/java/io/swagger/parser/OpenAPIParserTest.java b/modules/swagger-parser/src/test/java/io/swagger/parser/OpenAPIParserTest.java
index 70ad63c4..56960e18 100644
--- a/modules/swagger-parser/src/test/java/io/swagger/parser/OpenAPIParserTest.java
+++ b/modules/swagger-parser/src/test/java/io/swagger/parser/OpenAPIParserTest.java
@@ -1,8 +1,5 @@
 package io.swagger.parser;
 
-
-
-import io.swagger.v3.core.util.Yaml;
 import io.swagger.v3.oas.models.Components;
 import io.swagger.v3.oas.models.OpenAPI;
 import io.swagger.v3.oas.models.media.ArraySchema;
@@ -28,6 +25,7 @@ import static org.testng.Assert.assertNotNull;
 import static org.testng.Assert.assertTrue;
 
 public class OpenAPIParserTest {
+
     @Test
     public void testIssue749() {
         ParseOptions options = new ParseOptions();
diff --git a/modules/swagger-parser/src/test/resources/issue-901/CDK-Global-Int/Domain-Service/2.0.0.yaml b/modules/swagger-parser/src/test/resources/issue-901/CDK-Global-Int/Domain-Service/2.0.0.yaml
new file mode 100644
index 00000000..5f6e9710
--- /dev/null
+++ b/modules/swagger-parser/src/test/resources/issue-901/CDK-Global-Int/Domain-Service/2.0.0.yaml
@@ -0,0 +1,721 @@
+### Service Domain
+
+info:
+  description: "CDK Open Platform Domain : Service"
+  version: "2.0.0"
+  title: 'CDK Open Platform Domain : Service'
+
+definitions:
+  RepairOrder.RepairOrderJobDetails:
+    description: RepairOrderJobDetails use for Create and Get RepairOrderJob
+    type: object
+    properties:
+      jobId:
+        description: Job Id
+        type: string
+      jobType:
+        description: Job type
+        enum:
+          - SCHEDULED_MAINTENANCE
+          - GOVERNMENT_INSPECTION
+          - REPAIR
+          - OTHER
+        type: string
+      jobSource:
+        description: Job Source
+        enum:
+          - WORKSHOP
+          - VHC
+          - CUSTOMER_REQUEST
+          - MANUFACTURER
+          - OTHER
+        type: string
+      description:
+        description: Description
+        type: string
+      menus:
+        description: Menus
+        uniqueItems: false
+        type: array
+        items:
+          $ref: >-
+            #/definitions/RepairOrder.RepairOrderMenu
+      laborItems:
+        description: Labor Items
+        uniqueItems: false
+        type: array
+        items:
+          $ref: >-
+            #/definitions/RepairOrder.RepairOrderLabor
+      partItems:
+        description: Part Items
+        uniqueItems: false
+        type: array
+        items:
+          $ref: >-
+            #/definitions/RepairOrder.RepairOrderPart
+      textItems:
+        description: Text Items
+        uniqueItems: false
+        type: array
+        items:
+          $ref: >-
+            #/definitions/RepairOrder.RepairOrderText
+      feeItems:
+        description: Fee Items
+        uniqueItems: false
+        type: array
+        items:
+          $ref: >-
+            #/definitions/RepairOrder.RepairOrderFee
+      metadata:
+        $ref: '../Domain-Common/1.0.0.yaml#/definitions/Metadata'
+        description: Gets or Sets metadata
+  RepairOrder.RepairOrderMenu:
+    type: object
+    properties:
+      menuCode:
+        description: Menu code
+        type: string
+      brandCode:
+        description: Brand code of who has issued the menu
+        type: string
+      partItems:
+        description: PartItems belonging to this menu
+        uniqueItems: false
+        type: array
+        items:
+          $ref: >-
+            #/definitions/RepairOrder.RepairOrderPart
+      laborItems:
+        description: LaborItems belonging to this menu
+        uniqueItems: false
+        type: array
+        items:
+          $ref: >-
+            #/definitions/RepairOrder.RepairOrderLabor
+      textItems:
+        description: TextItems belonging to this menu
+        uniqueItems: false
+        type: array
+        items:
+          $ref: >-
+            #/definitions/RepairOrder.RepairOrderText
+      feeItems:
+        description: FeeItems belonging to this menu
+        uniqueItems: false
+        type: array
+        items:
+          $ref: >-
+            #/definitions/RepairOrder.RepairOrderFee
+      listPrice:
+        $ref: '../Domain-Common/1.0.0.yaml#/definitions/Price'
+        #$ref: '#/definitions/Common.Price'
+        description: Menu list price excluding all discounts
+      itemId:
+        description: Unique item (line) id in question among all repair order lines
+        type: string
+      sequenceNumber:
+        format: int32
+        description: Sequence number of the item in the order of all items.
+        type: integer
+      description:
+        description: Description
+        type: string
+      discountedPrice:
+        $ref: '../Domain-Common/1.0.0.yaml#/definitions/Price'
+        description: Item discounted price including all discounts.
+      notes:
+        description: General notes and comments for this line
+        type: string
+      linePayer:
+        description: "Who is paying the line in question.\r\nNote. Price is shown only if the payer is CUSTOMER."
+        enum:
+          - CUSTOMER
+          - DEALER
+          - WARRANTY
+          - CONTRACT
+          - OTHER
+        type: string
+  RepairOrder.RepairOrderLabor:
+    type: object
+    properties:
+      laborCode:
+        description: Labor code
+        type: string
+      brandCode:
+        description: Brand code of who has issued the labor
+        type: string
+      allowedTimeInMinutes:
+        format: int32
+        description: "Flat rate labor allowance (standard time) time in minutes issued by the provider.\r\nThis is the time how long (in average) it should take to perform the labor operation."
+        type: integer
+      listPrice:
+        $ref: '../Domain-Common/1.0.0.yaml#/definitions/Price'
+        description: "Item list price excluding all discounts.\r\nNote. If the labor is part of menu then the specific labor line might not have any price set."
+      itemId:
+        description: Unique item (line) id in question among all repair order lines
+        type: string
+      sequenceNumber:
+        format: int32
+        description: Sequence number of the item in the order of all items.
+        type: integer
+      description:
+        description: Description
+        type: string
+      discountedPrice:
+        $ref: '../Domain-Common/1.0.0.yaml#/definitions/Price'
+        description: Item discounted price including all discounts.
+      notes:
+        description: General notes and comments for this line
+        type: string
+      linePayer:
+        description: "Who is paying the line in question.\r\nNote. Price is shown only if the payer is CUSTOMER."
+        enum:
+          - CUSTOMER
+          - DEALER
+          - WARRANTY
+          - CONTRACT
+          - OTHER
+        type: string
+  RepairOrder.RepairOrderPart:
+    type: object
+    properties:
+      partId:
+        description: "Unique DMS part reference. This is the identifier used later on in the order process (for instance invoicing).\r\nWhen used in adding a part this field is optional.\r\nIf not given the brandCode+partCode is used to resolve the unique part.\r\nIf multiple parts are found DMS will pick one."
+        type: string
+      partCode:
+        description: Manufacturer part code
+        type: string
+      brandCode:
+        description: Brand code
+        type: string
+      unitOfMeasure:
+        description: Unit of measurement used for the part
+        enum:
+          - OTHER
+          - LITERS
+          - METER
+          - KG
+          - SQUAREMETERS
+          - PIECE
+        type: string
+      quantity:
+        format: double
+        description: Quantity of the part used on service
+        type: number
+      listPrice:
+        $ref: '../Domain-Common/1.0.0.yaml#/definitions/Price'
+        description: Item list price excluding all discounts.
+      itemId:
+        description: Unique item (line) id in question among all repair order lines
+        type: string
+      sequenceNumber:
+        format: int32
+        description: Sequence number of the item in the order of all items.
+        type: integer
+      description:
+        description: Description
+        type: string
+      discountedPrice:
+        $ref: '../Domain-Common/1.0.0.yaml#/definitions/Price'
+        description: Item discounted price including all discounts.
+      notes:
+        description: General notes and comments for this line
+        type: string
+      linePayer:
+        description: "Who is paying the line in question.\r\nNote. Price is shown only if the payer is CUSTOMER."
+        enum:
+          - CUSTOMER
+          - DEALER
+          - WARRANTY
+          - CONTRACT
+          - OTHER
+        type: string
+  RepairOrder.RepairOrderText:
+    type: object
+    properties:
+      itemId:
+        description: >-
+          Unique item (line) id for the Text in question among all repair order
+          lines
+        type: string
+      sequenceNumber:
+        format: int32
+        description: Sequence number of the item in the order of all items.
+        type: integer
+      notes:
+        description: General notes and comments
+        type: string
+  RepairOrder.RepairOrderFee:
+    type: object
+    properties:
+      code:
+        description: Code for fee (if any available)
+        type: string
+      itemId:
+        description: Unique item (line) id in question among all repair order lines
+        type: string
+      sequenceNumber:
+        format: int32
+        description: Sequence number of the item in the order of all items.
+        type: integer
+      description:
+        description: Description
+        type: string
+      discountedPrice:
+        $ref: '../Domain-Common/1.0.0.yaml#/definitions/Price'
+        description: Item discounted price including all discounts.
+      notes:
+        description: General notes and comments for this line
+        type: string
+      linePayer:
+        description: "Who is paying the line in question.\r\nNote. Price is shown only if the payer is CUSTOMER."
+        enum:
+          - CUSTOMER
+          - DEALER
+          - WARRANTY
+          - CONTRACT
+          - OTHER
+        type: string
+  RepairOrder.RepairOrderJobResponse201:
+    description: RepairOrderJobResponse201
+    type: object
+    properties:
+      jobId:
+        type: string
+  RepairOrder.RepairOrderJobResponse200:
+    description: RepairOrderJobResponse200
+    type: object
+    properties:
+      jobId:
+        description: JobId
+        type: string
+      jobType:
+        description: JobType
+        enum:
+          - SCHEDULED_MAINTENANCE
+          - GOVERNMENT_INSPECTION
+          - REPAIR
+          - OTHER
+        type: string
+      jobSource:
+        description: JobSource
+        enum:
+          - WORKSHOP
+          - VHC
+          - CUSTOMER_REQUEST
+          - MANUFACTURER
+          - OTHER
+        type: string
+      description:
+        description: Description
+        type: string
+      menus:
+        description: Menus
+        uniqueItems: false
+        type: array
+        items:
+          $ref: >-
+            #/definitions/RepairOrder.RepairOrderMenu
+      laborItems:
+        description: Labor Items
+        uniqueItems: false
+        type: array
+        items:
+          $ref: >-
+            #/definitions/RepairOrder.RepairOrderLabor
+      partItems:
+        description: Part Items
+        uniqueItems: false
+        type: array
+        items:
+          $ref: >-
+            #/definitions/RepairOrder.RepairOrderPart
+      textItems:
+        description: Text Items
+        uniqueItems: false
+        type: array
+        items:
+          $ref: >-
+            #/definitions/RepairOrder.RepairOrderText
+      feeItems:
+        description: Fee Items
+        uniqueItems: false
+        type: array
+        items:
+          $ref: >-
+            #/definitions/RepairOrder.RepairOrderFee
+      links:
+        description: Links to related objects
+        uniqueItems: false
+        type: array
+        items:
+          $ref: '../Domain-Common/1.0.0.yaml#/definitions/Links'
+  RepairOrder.RepairOrderResponse200:
+    description: ''
+    type: object
+    properties:
+      repairOrderId:
+        description: The id of the vehicle assigned to the repair order
+        type: string
+      status:
+        description: The current status of the repair order.
+        enum:
+          - CREATED
+          - ONHOLD
+          - CHECKEDIN
+          - WORKSTARTED
+          - WORKCOMPLETED
+          - CHECKEDOUT
+          - CLOSED
+        type: string
+      details:
+        $ref: >-
+          #/definitions/RepairOrder.RepairOrderDetails
+        description: Basic information about the repair order
+      vehicle:
+        $ref: '../Domain-Common/1.0.0.yaml#/definitions/Vehicle.VehicleBaseModel'
+        description: Vehicle information
+      customer:
+        $ref: >-
+          #/definitions/RepairOrder.OrderCustomer
+        description: Customer information
+      company:
+        $ref: >-
+          #/definitions/RepairOrder.OrderCompany
+        description: Company information
+      contact:
+        $ref: >-
+          #/definitions/RepairOrder.OrderContact
+        description: Contact information for the customer/company representative
+      resources:
+        $ref: >-
+          #/definitions/RepairOrder.RepairOrderResources
+        description: >-
+          The human resources (service advisor, etc) associated with the repair
+          order.
+      appointment:
+        $ref: >-
+          #/definitions/RepairOrder.RepairOrderAppointment
+        description: >-
+          Information about the workshop planning and appointment aspects of the
+          repair-order.
+      planning:
+        $ref: >-
+          #/definitions/RepairOrder.RepairOrderPlanning
+        description: Planning information related to the service.
+      jobs:
+        description: Collection of job that are performed to the vehicle.
+        uniqueItems: false
+        type: array
+        items:
+          $ref: >-
+            #/definitions/RepairOrder.RepairOrderJob
+      links:
+        description: Links to related objects
+        uniqueItems: false
+        type: array
+        items:
+          $ref: '../Domain-Common/1.0.0.yaml#/definitions/Links'
+  RepairOrder.RepairOrderDetails:
+    type: object
+    properties:
+      notes:
+        description: Repair order notes/comments information.
+        type: string
+      checkInDateTime:
+        format: date-time
+        description: Date and time when the vehicle was checked in.
+        type: string
+      checkOutDateTime:
+        format: date-time
+        description: Date and time when the vehicle was checked out
+        type: string
+      checkInMileage:
+        $ref: '../Domain-Common/1.0.0.yaml#/definitions/Vehicle.VehicleMileage'
+        description: Mileage when the vehicle was checked in
+      checkOutMileage:
+        $ref: '../Domain-Common/1.0.0.yaml#/definitions/Vehicle.VehicleMileage'
+        description: Mileage when the vehicle was checked out
+      onHoldReason:
+        description: Reason why the repair-order is on hold
+        type: string
+
+  RepairOrder.OrderCustomer:
+    type: object
+    properties:
+      customerId:
+        description: Unique customer id in DMS
+        type: string
+      names:
+        $ref: '../Domain-Common/1.0.0.yaml#/definitions/Customer.CustomerNames'
+        description: Customer names
+      addresses:
+        $ref: >-
+          ../Domain-Common/1.0.0.yaml#/definitions/Customer.CustomerAddresses
+        description: Customer addresses
+      communication:
+        $ref: >-
+          ../Domain-Common/1.0.0.yaml#/definitions/Customer.CustomerCommunication
+        description: Customer communication methods
+  RepairOrder.OrderCompany:
+    type: object
+    properties:
+      companyId:
+        description: The unique id for the company
+        type: string
+      identification:
+        $ref: >-
+          ../Domain-Common/1.0.0.yaml#/definitions/Company.CompanyIdentification
+        description: Company identification
+      addresses:
+        $ref: >-
+          ../Domain-Common/1.0.0.yaml#/definitions/Company.CompanyAddresses
+        description: Company addresses
+      communication:
+        $ref: >-
+          ../Domain-Common/1.0.0.yaml#/definitions/Company.CompanyCommunication
+        description: Company communication
+  RepairOrder.OrderContact:
+    type: object
+    properties:
+      name:
+        description: Contact name
+        type: string
+      phone:
+        description: Contact phone number
+        type: string
+      email:
+        description: Contact e-mail address
+        type: string
+      address:
+        $ref: '../Domain-Common/1.0.0.yaml#/definitions/AddressPhysical'
+        description: Contact address
+  RepairOrder.RepairOrderResources:
+    type: object
+    properties:
+      assignedAdvisor:
+        $ref: >-
+          #/definitions/RepairOrder.RepairOrderServiceAdvisor
+        description: Service advisor to whom the order is currently assigned
+      contactAdvisor:
+        $ref: >-
+          #/definitions/RepairOrder.RepairOrderServiceAdvisor
+        description: Service advisor who is handling the communication with customer
+  RepairOrder.RepairOrderAppointment:
+    type: object
+    properties:
+      notes:
+        description: General notes and comments for the appointment
+        type: string
+      bookingOptions:
+        $ref: >-
+          #/definitions/RepairOrder.RepairOrderBookingOptions
+        description: Booking options
+      dueInDateTime:
+        format: date-time
+        description: >-
+          Date and time when the customer is supposed to be bringing in the
+          vehicle.
+        type: string
+      dueOutDateTime:
+        format: date-time
+        description: >-
+          Date and time when the customer is supposed to be taking out the
+          vehicle.
+        type: string
+  RepairOrder.RepairOrderPlanning:
+    type: object
+    properties:
+      plannedIn:
+        format: date-time
+        description: >-
+          The date and time when the complete work is planned in the workshop
+          planning.
+        type: string
+      plannedOut:
+        format: date-time
+        description: >-
+          The date and time when the complete work is planned to be finished in
+          the workshop planning.
+        type: string
+  RepairOrder.RepairOrderJob:
+    description: RepairOrderJob use for RepairOrder
+    type: object
+    properties:
+      jobId:
+        description: Job Id
+        type: string
+      jobType:
+        description: Job type
+        enum:
+          - SCHEDULED_MAINTENANCE
+          - GOVERNMENT_INSPECTION
+          - REPAIR
+          - OTHER
+        type: string
+      jobSource:
+        description: Job Source
+        enum:
+          - WORKSHOP
+          - VHC
+          - CUSTOMER_REQUEST
+          - MANUFACTURER
+          - OTHER
+        type: string
+      description:
+        description: Description
+        type: string
+  RepairOrder.RepairOrderServiceAdvisor:
+    type: object
+    properties:
+      serviceAdvisorId:
+        description: Service advisor id
+        type: string
+      name:
+        description: Service advisor name
+        type: string
+  RepairOrder.RepairOrderBookingOptions:
+    type: object
+    properties:
+      type:
+        description: Type of booking option required by the customer.
+        enum:
+          - NONE
+          - WAITER
+          - SHUTTLE
+          - REPLACEMENT_TRANSPORT
+          - COLLECT_DELIVER
+        type: string
+  RepairOrder.RepairOrderSearchResponse200:
+    description: ''
+    type: object
+    properties:
+      totalItems:
+        format: int32
+        description: >-
+          Used to indicate the total number of items in the full result list,
+          not just this page
+        type: integer
+      totalPages:
+        format: int32
+        description: 'Used to indicate how many pages are available, in total'
+        type: integer
+      repairOrders:
+        description: Search results
+        uniqueItems: false
+        type: array
+        items:
+          $ref: >-
+            #/definitions/RepairOrder.RepairOrderSearchResults
+      links:
+        description: Gets or Sets Links
+        uniqueItems: false
+        type: array
+        items:
+          $ref: '../Domain-Common/1.0.0.yaml#/definitions/Links'
+  RepairOrder.RepairOrderSearchResults:
+    type: object
+    properties:
+      repairOrderId:
+        description: The id of the repair order
+        type: string
+      status:
+        description: The status of the repair order
+        enum:
+          - CREATED
+          - ONHOLD
+          - CHECKEDIN
+          - WORKSTARTED
+          - WORKCOMPLETED
+          - CHECKEDOUT
+          - CLOSED
+        type: string
+      vehicle:
+        $ref: '../Domain-Common/1.0.0.yaml#/definitions/Vehicle.VehicleBaseModel'
+        description: The vehicle of the repair order
+      customer:
+        $ref: >-
+          #/definitions/RepairOrder.OrderCustomer
+        description: The customer of the repair order
+      company:
+        $ref: >-
+          #/definitions/RepairOrder.OrderCompany
+        description: The company of the repair order
+      details:
+        $ref: >-
+          #/definitions/RepairOrder.RepairOrderDetails
+        description: The details of the repair order
+      planning:
+        $ref: >-
+          #/definitions/RepairOrder.RepairOrderPlanning
+        description: The planning of the repair order
+      contact:
+        $ref: >-
+          #/definitions/RepairOrder.OrderContact
+        description: The contact of the repair order
+  Vehicle.InspectionsUpdatePayload:
+    type: object
+    properties:
+      vehicleInspection:
+        $ref: >-
+          #/definitions/Vehicle.InspectionUpdate
+      metadata:
+        $ref: '../Domain-Common/1.0.0.yaml#/definitions/Metadata'
+  Vehicle.InspectionUpdate:
+    type: object
+    properties:
+      dueDate:
+        format: date-time
+        description: The DueDate for the vehicle inspection
+        type: string
+  Vehicle.VehicleNextServicePayload:
+    type: object
+    properties:
+      nextService:
+        $ref: >-
+          #/definitions/Vehicle.VehicleNextService
+      metadata:
+        $ref: '../Domain-Common/1.0.0.yaml#/definitions/Metadata'
+  Vehicle.VehicleNextService:
+    type: object
+    properties:
+      description:
+        type: string
+      dueDate:
+        format: date-time
+        type: string
+      dueMileage:
+        $ref: '../Domain-Common/1.0.0.yaml#/definitions/Vehicle.VehicleMileage'
+  Vehicle.InspectionsResponse200:
+    type: object
+    properties:
+      inspections:
+        $ref: '#/definitions/Vehicle.Inspections'
+        description: The inspections related value
+      links:
+        description: Links to related objects
+        uniqueItems: false
+        type: array
+        items:
+          $ref: '../Domain-Common/1.0.0.yaml#/definitions/Links'
+  Vehicle.Inspections:
+    type: object
+    properties:
+      vehicleInspection:
+        $ref: '#/definitions/Vehicle.Inspection'
+        description: Gets or Sets VehicleInspection
+  Vehicle.Inspection:
+    type: object
+    properties:
+      lastDate:
+        format: date-time
+        description: The date of the last mot of the vehicle
+        type: string
+      dueDate:
+        format: date-time
+        description: The date of the mot due of the vehicle
+        type: string
+
+#end of spec
\ No newline at end of file