Browse Source

Bug 28272: Prevent api spec to accept extra parameters

Some of our definition files are missing { additionalProperties: false }
We must have it to make sure all properties are defined and prevent the
spec to accept extra parameters (being more strict but also allowing to
catch errors more easily)

grep -rL additionalProperties api/v1/swagger/definitions/*.json

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
21.05.x
Jonathan Druart 9 months ago
parent
commit
14ab5abf44
  1. 3
      api/v1/swagger/definitions/account_line.json
  2. 3
      api/v1/swagger/definitions/allows_renewal.json
  3. 3
      api/v1/swagger/definitions/basket.json
  4. 3
      api/v1/swagger/definitions/cashup.json
  5. 5
      api/v1/swagger/definitions/checkout.json
  6. 3
      api/v1/swagger/definitions/checkouts.json
  7. 5
      api/v1/swagger/definitions/club_hold.json
  8. 5
      api/v1/swagger/definitions/club_hold_patron_hold.json
  9. 5
      api/v1/swagger/definitions/club_hold_patron_holds.json
  10. 5
      api/v1/swagger/definitions/club_holds.json
  11. 3
      api/v1/swagger/definitions/error.json
  12. 3
      api/v1/swagger/definitions/hold.json
  13. 3
      api/v1/swagger/definitions/holds.json
  14. 3
      api/v1/swagger/definitions/ill_backend.json
  15. 3
      api/v1/swagger/definitions/ill_backends.json
  16. 5
      api/v1/swagger/definitions/import_batch_profile.json
  17. 5
      api/v1/swagger/definitions/import_batch_profiles.json
  18. 3
      api/v1/swagger/definitions/patron_account_credit.json
  19. 3
      api/v1/swagger/definitions/return_claim.json

3
api/v1/swagger/definitions/account_line.json

@ -97,5 +97,6 @@
],
"description": "Internal identifier for the library in which the transaction took place"
}
}
},
"additionalProperties": false
}

3
api/v1/swagger/definitions/allows_renewal.json

@ -17,5 +17,6 @@
"type": ["string", "null"],
"description": "Description on false allows_renewal."
}
}
},
"additionalProperties": false
}

3
api/v1/swagger/definitions/basket.json

@ -95,5 +95,6 @@
],
"description": "When items should be created for orders in this basket (Options: 'ordering', 'receiving', 'cataloguing'. Null means system wide config)"
}
}
},
"additionalProperties": false
}

3
api/v1/swagger/definitions/cashup.json

@ -26,5 +26,6 @@
"type": "object",
"description": "A summary of the cashup action"
}
}
},
"additionalProperties": false
}

5
api/v1/swagger/definitions/checkout.json

@ -79,6 +79,7 @@
"null"
],
"description": "The object representing the checkout issuer"
}
}
}
},
"additionalProperties": false
}

3
api/v1/swagger/definitions/checkouts.json

@ -2,5 +2,6 @@
"type": "array",
"items": {
"$ref": "checkout.json"
}
},
"additionalProperties": false
}

5
api/v1/swagger/definitions/club_hold.json

@ -17,5 +17,6 @@
"type": ["string", "null"],
"description": "Internal item identifier"
}
}
}
},
"additionalProperties": false
}

5
api/v1/swagger/definitions/club_hold_patron_hold.json

@ -26,5 +26,6 @@
"type": ["string", "null"],
"description": "Generic error message"
}
}
}
},
"additionalProperties": false
}

5
api/v1/swagger/definitions/club_hold_patron_holds.json

@ -2,5 +2,6 @@
"type": "array",
"items": {
"$ref": "club_hold_patron_hold.json"
}
}
},
"additionalProperties": false
}

5
api/v1/swagger/definitions/club_holds.json

@ -2,5 +2,6 @@
"type": "array",
"items": {
"$ref": "club_hold.json"
}
}
},
"additionalProperties": false
}

3
api/v1/swagger/definitions/error.json

@ -5,5 +5,6 @@
"description": "Error message",
"type": "string"
}
}
},
"additionalProperties": false
}

3
api/v1/swagger/definitions/hold.json

@ -83,5 +83,6 @@
"type": "boolean",
"description": "If the hold is placed at item level"
}
}
},
"additionalProperties": false
}

3
api/v1/swagger/definitions/holds.json

@ -2,5 +2,6 @@
"type": "array",
"items": {
"$ref": "hold.json"
}
},
"additionalProperties": false
}

3
api/v1/swagger/definitions/ill_backend.json

@ -9,5 +9,6 @@
"type": "object",
"description": "List of capabilities"
}
}
},
"additionalProperties": false
}

3
api/v1/swagger/definitions/ill_backends.json

@ -2,5 +2,6 @@
"type": "array",
"items": {
"$ref": "ill_backend.json"
}
},
"additionalProperties": false
}

5
api/v1/swagger/definitions/import_batch_profile.json

@ -49,5 +49,6 @@
"description": "any comments added when the file was uploaded",
"type": ["string", "null"]
}
}
}
},
"additionalProperties": false
}

5
api/v1/swagger/definitions/import_batch_profiles.json

@ -2,5 +2,6 @@
"type": "array",
"items": {
"$ref": "import_batch_profile.json"
}
}
},
"additionalProperties": false
}

3
api/v1/swagger/definitions/patron_account_credit.json

@ -39,5 +39,6 @@
"description": "Internal note"
}
},
"required": [ "amount" ]
"required": [ "amount" ],
"additionalProperties": false
}

3
api/v1/swagger/definitions/return_claim.json

@ -89,5 +89,6 @@
],
"description": "patron id of librarian who resolved this claim"
}
}
},
"additionalProperties": false
}

Loading…
Cancel
Save