swagger should not have additional properties using OpenAPI (3.0.0)
我查看了已经提出的问题,但没有一个能够解决我的问题。
我正在使用
Error:
should not have additional properties:
additionalProperty: /author/author{id}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | # openapi: 3.0.0 # info: # version: 0.0.1 # title: Author API # description: Author API documentation openapi: 3.0.0 info: title: Author API description: Author API version: 0.0.1 servers: - url: 'http://localhost:8080/' description: Local dev server # post new author done # find author {id} done # get all author done # update author {id} done # delete author {id} done paths: /author: post: summary: Add a author to database requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Author' responses: '201': description: return the author to the user with the id attached content: application/json: schema: $ref: '#/components/schemas/Author' get: summary: Get all the authors in the database responses: '200': description: Return all the authors in the database content: application/json: schema: type: array items: $ref: '#/components/schemas/Author' /author/{authorId}: update: summary: update the author with the id parameters: - name: authorId in: path required: true description: Id of the author to update schema: type: integer responses: '200': description: Return just the author at that id content: application/json: schema: $ref: '#/components/schemas/Author' get: summary: get the author with the specific id paramaters: - name: authorId in : path required: true description: Id of the author to retrieve schema: type: integer responses: '200': description: Return just the author at that id content: application/json: schema: $ref: '#/components/schemas/Author' delete: summary: Remove a author by the given Id parameters: - name: authorId in: path required: true description: Id of the author to delete schema: type: integer responses: '200': description: The author was successfully removed components: schemas: Author: type: object properties: authorId: type: integer firstName: type: string lastName: type: string street: type: string city: type: string state: type: string postalCode: type: string phone: type: string email: type : string |
在
1 2 3 4 5 | paths: /author: ... /author/{authorId}: ... |