Koha/api/v1/swagger/definitions/import_batch_profile.json
Tomas Cohen Arazi 741d8a0e53 Bug 28272: Fix many things...
This patch could've been splitted into several. But, overall, adding
additionalAttributes: false made the API fail on requests that send
extra info (i.e. cases in which a dev added an attribute to the
underlaying class/table and forgot to deal with it on the API (either
adding it on the spec, or removing it from the response using
Koha::Class::to_api_mapping).

- Koha::Account::Line was missing: credit_type, interface, status,
  register_id and credit_number. I decided to call cash_register_id, and
  to remove credit_number from the response.
  FIXME: We need consensus on a name for the credit_number attribute, and
  add it to the response on the API. It deserves a separate bug. Too
  opinionated for a last-minute fix.
- Koha::Club::Hold::add was returning bad auto-calculated values on
  field that (also) wasn't specified on the spec. Needs a test.
- import_batch_profile had a typo: id_profile vs. profile_id.
- error.json: In this case I reverted the change. This is because some
  routes are adding more 'info' with the error message, and I consider
  this should be done in a more generic approach. Time is required for
  us to think about this. So don't break the API in the meantime.
  FIXME: Implement a generic way to add a payload to error messages on
  the API. Maybe something to work on while on bug 28020.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/
=> FAIL: Lots of tests fail
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests pass!
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-05-11 09:04:13 +02:00

54 lines
1.4 KiB
JSON

{
"type": "object",
"properties": {
"profile_id": {
"type": "integer",
"description": "Internal profile identifier"
},
"name": {
"description": "name of this profile",
"type": "string"
},
"matcher_id": {
"description": "the id of the match rule used (matchpoints.matcher_id)",
"type": ["integer", "null"]
},
"template_id": {
"description": "the id of the marc modification template",
"type": ["integer", "null"]
},
"overlay_action": {
"description": "how to handle duplicate records",
"type": ["string", "null"]
},
"nomatch_action": {
"description": "how to handle records where no match is found",
"type": ["string", "null"]
},
"item_action": {
"description": "what to do with item records",
"type": ["string", "null"]
},
"parse_items": {
"description": "should items be parsed",
"type": ["boolean", "null"]
},
"record_type": {
"description": "type of record in the batch",
"type": ["string", "null"]
},
"encoding": {
"description": "file encoding",
"type": ["string", "null"]
},
"format": {
"description": "marc format",
"type": ["string", "null"]
},
"comments": {
"description": "any comments added when the file was uploaded",
"type": ["string", "null"]
}
},
"additionalProperties": false
}