Bugzilla – Attachment 159650 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
on 2023-12-07 13:24:26 UTC
(
hide
)
Description:
Bug 35197: Field name consistency
Filename:
MIME Type:
Creator:
Martin Renvoize
Created:
2023-12-07 13:24:26 UTC
Size:
2.67 KB
patch
obsolete
>From e068865a14d63f2072478e97ac3db7f79b7fd6fc 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.43.0
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