Bugzilla – Attachment 168059 Details for
Bug 35197
Expose additional_field definitions through REST API
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35197: Field name consistency
Bug-35197-Field-name-consistency.patch (text/plain), 2.67 KB, created by
Martin Renvoize (ashimema)
on 2024-06-25 12:08:25 UTC
(
hide
)
Description:
Bug 35197: Field name consistency
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-06-25 12:08:25 UTC
Size:
2.67 KB
patch
obsolete
>From 2742ded0bdb7fad3f576b29545c4c4b034062531 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 7 Dec 2023 13:03:12 +0000 >Subject: [PATCH] Bug 35197: Field name consistency > >This patch adds a to_api_mapping and updates the yaml definitions to be >ensure we are consistent with modern best practice for our api field >names. > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/AdditionalField.pm | 17 +++++++++++++++++ > .../swagger/definitions/additional_field.yaml | 18 +++++++++--------- > 2 files changed, 26 insertions(+), 9 deletions(-) > >diff --git a/Koha/AdditionalField.pm b/Koha/AdditionalField.pm >index 77a43724cce..19f93c7cd93 100644 >--- a/Koha/AdditionalField.pm >+++ b/Koha/AdditionalField.pm >@@ -42,6 +42,23 @@ sub effective_authorised_value_category { > return $category; > } > >+=head3 to_api_mapping >+ >+This method returns the mapping for representing an AdditionalField object >+on the API. >+ >+=cut >+ >+sub to_api_mapping { >+ return { >+ id => 'additional_field_id', >+ tablename => 'table_name', >+ authorised_value_category => 'authorised_value_category_name', >+ marcfield => 'marc_field', >+ marcfield_mode => 'marc_field_mode' >+ }; >+} >+ > sub _type { 'AdditionalField' } > > =head1 AUTHOR >diff --git a/api/v1/swagger/definitions/additional_field.yaml b/api/v1/swagger/definitions/additional_field.yaml >index 5fa3a3e6995..35d5097c455 100644 >--- a/api/v1/swagger/definitions/additional_field.yaml >+++ b/api/v1/swagger/definitions/additional_field.yaml >@@ -1,26 +1,26 @@ > --- > type: object > properties: >- id: >+ additional_field_id: > type: integer > description: internally assigned additional field identifier > readOnly: true >- tablename: >+ table_name: > description: name of the table this additional field corresponds to > type: string > name: > description: name of the additional field > type: string >- authorised_value_category: >+ authorised_value_category_name: > description: authorised value category of the additional field > type: > - string > - "null" >- marcfield: >- description: marcfield of the additional field >+ marc_field: >+ description: marc field of the additional field > type: string >- marcfield_mode: >- description: marcfield mode of the additional field >+ marc_field_mode: >+ description: marc field mode of the additional field > type: string > enum: > - get >@@ -31,5 +31,5 @@ properties: > > additionalProperties: false > required: >- - id >- - tablename >\ No newline at end of file >+ - additional_field_id >+ - table_name >-- >2.45.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 35197
:
158112
|
158511
|
158512
|
158514
|
158515
|
158577
|
158578
|
159648
|
159649
|
159650
|
165726
|
165727
|
165728
|
165769
|
165780
|
168057
|
168058
| 168059 |
168060
|
168061
|
168062
|
168063
|
168064
|
168065