updated comments and added json string value normalizations info panel

This commit is contained in:
Gani Georgiev
2023-01-29 16:00:03 +02:00
parent c928de08f9
commit 0de459efe8
3 changed files with 177 additions and 95 deletions
+7 -5
View File
@@ -1,8 +1,8 @@
## (WIP) v0.12.0
## v0.12.0
- Refactored the relation picker UI, allowing inline search, sorting, create, update and delete of relation records ([#976](https://github.com/pocketbase/pocketbase/issues/976)).
- Refactored the relation picker UI, allowing server-side search, sorting, create, update and delete of relation records ([#976](https://github.com/pocketbase/pocketbase/issues/976)).
- Added optional `RelationOptions.DisplayFields` slice to specify custom relation field(s) visualization in the Admin UI.
- Added new `RelationOptions.DisplayFields` option to specify custom relation field(s) visualization in the Admin UI.
- Added Authentik OAuth2 provider ([#1377](https://github.com/pocketbase/pocketbase/pull/1377); thanks @pr0ton11).
@@ -15,6 +15,7 @@
- Added video and audio file previews.
- Added rich text editor (`editor`) field for HTML content based on TinyMCE ([#370](https://github.com/pocketbase/pocketbase/issues/370)).
_Currently the new field doesn't have any configuration options or validations but this may change in the future depending on how devs ended up using it._
- Added "Duplicate" Collection and Record options in the Admin UI ([#1656](https://github.com/pocketbase/pocketbase/issues/1656)).
@@ -69,8 +70,9 @@
- Fixed `json` field string value normalizations and vizualization in the Admin UI ([#1703](https://github.com/pocketbase/pocketbase/issues/1703)).
In order to support seamlessly both json and multipart/form-data request bodies,
the following normalization rules are applied for plain `json` field string values:
In order to support seamlessly both `application/json` and `multipart/form-data`
requests, the following normalization rules are applied if the `json` field is a
plain **string** value:
- "true" is converted to the json `true`
- "false" is converted to the json `false`
- "null" is converted to the json `null`
+126 -90
View File
@@ -125,49 +125,49 @@ type App interface {
// OnModelBeforeCreate hook is triggered before inserting a new
// entry in the DB, allowing you to modify or validate the stored data.
//
// You can optionally specify a list of "tags"
// (table names and/or the Collection id for Record models)
// to filter any the newly attached event data handler.
// If the optional "tags" list (table names and/or the Collection id for Record models)
// is specified, then all event handlers registered via the created hook
// will be triggered and called only if their event data origin matches the tags.
OnModelBeforeCreate(tags ...string) *hook.TaggedHook[*ModelEvent]
// OnModelAfterCreate hook is triggered after successfully
// inserting a new entry in the DB.
//
// You can optionally specify a list of "tags"
// (table names and/or the Collection id for Record models)
// to filter any the newly attached event data handler.
// If the optional "tags" list (table names and/or the Collection id for Record models)
// is specified, then all event handlers registered via the created hook
// will be triggered and called only if their event data origin matches the tags.
OnModelAfterCreate(tags ...string) *hook.TaggedHook[*ModelEvent]
// OnModelBeforeUpdate hook is triggered before updating existing
// entry in the DB, allowing you to modify or validate the stored data.
//
// You can optionally specify a list of "tags"
// (table names and/or the Collection id for Record models)
// to filter any the newly attached event data handler.
// If the optional "tags" list (table names and/or the Collection id for Record models)
// is specified, then all event handlers registered via the created hook
// will be triggered and called only if their event data origin matches the tags.
OnModelBeforeUpdate(tags ...string) *hook.TaggedHook[*ModelEvent]
// OnModelAfterUpdate hook is triggered after successfully updating
// existing entry in the DB.
//
// You can optionally specify a list of "tags"
// (table names and/or the Collection id for Record models)
// to filter any the newly attached event data handler.
// If the optional "tags" list (table names and/or the Collection id for Record models)
// is specified, then all event handlers registered via the created hook
// will be triggered and called only if their event data origin matches the tags.
OnModelAfterUpdate(tags ...string) *hook.TaggedHook[*ModelEvent]
// OnModelBeforeDelete hook is triggered before deleting an
// existing entry from the DB.
//
// You can optionally specify a list of "tags"
// (table names and/or the Collection id for Record models)
// to filter any the newly attached event data handler.
// If the optional "tags" list (table names and/or the Collection id for Record models)
// is specified, then all event handlers registered via the created hook
// will be triggered and called only if their event data origin matches the tags.
OnModelBeforeDelete(tags ...string) *hook.TaggedHook[*ModelEvent]
// OnModelAfterDelete is triggered after successfully deleting an
// existing entry from the DB.
//
// You can optionally specify a list of "tags"
// (table names and/or the Collection id for Record models)
// to filter any the newly attached event data handler.
// If the optional "tags" list (table names and/or the Collection id for Record models)
// is specified, then all event handlers registered via the created hook
// will be triggered and called only if their event data origin matches the tags.
OnModelAfterDelete(tags ...string) *hook.TaggedHook[*ModelEvent]
// ---------------------------------------------------------------
@@ -191,15 +191,17 @@ type App interface {
// Could be used to send your own custom email template if
// [hook.StopPropagation] is returned in one of its listeners.
//
// You can optionally specify a list of "tags" (Collection ids or names)
// to filter any newly attached event data handler.
// If the optional "tags" list (Collection ids or names) is specified,
// then all event handlers registered via the created hook will be
// triggered and called only if their event data origin matches the tags.
OnMailerBeforeRecordResetPasswordSend(tags ...string) *hook.TaggedHook[*MailerRecordEvent]
// OnMailerAfterRecordResetPasswordSend hook is triggered after
// an auth record password reset email was successfully sent.
//
// You can optionally specify a list of "tags" (Collection ids or names)
// to filter any newly attached event data handler.
// If the optional "tags" list (Collection ids or names) is specified,
// then all event handlers registered via the created hook will be
// triggered and called only if their event data origin matches the tags.
OnMailerAfterRecordResetPasswordSend(tags ...string) *hook.TaggedHook[*MailerRecordEvent]
// OnMailerBeforeRecordVerificationSend hook is triggered right before
@@ -208,15 +210,17 @@ type App interface {
// Could be used to send your own custom email template if
// [hook.StopPropagation] is returned in one of its listeners.
//
// You can optionally specify a list of "tags" (Collection ids or names)
// to filter any newly attached event data handler.
// If the optional "tags" list (Collection ids or names) is specified,
// then all event handlers registered via the created hook will be
// triggered and called only if their event data origin matches the tags.
OnMailerBeforeRecordVerificationSend(tags ...string) *hook.TaggedHook[*MailerRecordEvent]
// OnMailerAfterRecordVerificationSend hook is triggered after a
// verification email was successfully sent to an auth record.
//
// You can optionally specify a list of "tags" (Collection ids or names)
// to filter any newly attached event data handler.
// If the optional "tags" list (Collection ids or names) is specified,
// then all event handlers registered via the created hook will be
// triggered and called only if their event data origin matches the tags.
OnMailerAfterRecordVerificationSend(tags ...string) *hook.TaggedHook[*MailerRecordEvent]
// OnMailerBeforeRecordChangeEmailSend hook is triggered right before
@@ -225,15 +229,17 @@ type App interface {
// Could be used to send your own custom email template if
// [hook.StopPropagation] is returned in one of its listeners.
//
// You can optionally specify a list of "tags" (Collection ids or names)
// to filter any newly attached event data handler.
// If the optional "tags" list (Collection ids or names) is specified,
// then all event handlers registered via the created hook will be
// triggered and called only if their event data origin matches the tags.
OnMailerBeforeRecordChangeEmailSend(tags ...string) *hook.TaggedHook[*MailerRecordEvent]
// OnMailerAfterRecordChangeEmailSend hook is triggered after a
// verification email was successfully sent to an auth record.
//
// You can optionally specify a list of "tags" (Collection ids or names)
// to filter any newly attached event data handler.
// If the optional "tags" list (Collection ids or names) is specified,
// then all event handlers registered via the created hook will be
// triggered and called only if their event data origin matches the tags.
OnMailerAfterRecordChangeEmailSend(tags ...string) *hook.TaggedHook[*MailerRecordEvent]
// ---------------------------------------------------------------
@@ -409,8 +415,9 @@ type App interface {
// Could be used to additionally validate or modify the authenticated
// record data and token.
//
// You can optionally specify a list of "tags" (Collection ids or names)
// to filter any newly attached event data handler.
// If the optional "tags" list (Collection ids or names) is specified,
// then all event handlers registered via the created hook will be
// triggered and called only if their event data origin matches the tags.
OnRecordAuthRequest(tags ...string) *hook.TaggedHook[*RecordAuthEvent]
// OnRecordBeforeAuthWithPasswordRequest hook is triggered before each Record
@@ -419,15 +426,17 @@ type App interface {
// Could be used to implement for example a custom password validation
// or to locate a different Record identity (by assigning [RecordAuthWithPasswordEvent.Record]).
//
// You can optionally specify a list of "tags" (Collection ids or names)
// to filter any newly attached event data handler.
// If the optional "tags" list (Collection ids or names) is specified,
// then all event handlers registered via the created hook will be
// triggered and called only if their event data origin matches the tags.
OnRecordBeforeAuthWithPasswordRequest(tags ...string) *hook.TaggedHook[*RecordAuthWithPasswordEvent]
// OnRecordAfterAuthWithPasswordRequest hook is triggered after each
// successful Record auth with password API request.
//
// You can optionally specify a list of "tags" (Collection ids or names)
// to filter any newly attached event data handler.
// If the optional "tags" list (Collection ids or names) is specified,
// then all event handlers registered via the created hook will be
// triggered and called only if their event data origin matches the tags.
OnRecordAfterAuthWithPasswordRequest(tags ...string) *hook.TaggedHook[*RecordAuthWithPasswordEvent]
// OnRecordBeforeAuthWithOAuth2Request hook is triggered before each Record
@@ -439,15 +448,17 @@ type App interface {
// To assign or link a different existing record model you can
// overwrite/modify the [RecordAuthWithOAuth2Event.Record] field.
//
// You can optionally specify a list of "tags" (Collection ids or names)
// to filter any newly attached event data handler.
// If the optional "tags" list (Collection ids or names) is specified,
// then all event handlers registered via the created hook will be
// triggered and called only if their event data origin matches the tags.
OnRecordBeforeAuthWithOAuth2Request(tags ...string) *hook.TaggedHook[*RecordAuthWithOAuth2Event]
// OnRecordAfterAuthWithOAuth2Request hook is triggered after each
// successful Record OAuth2 API request.
//
// You can optionally specify a list of "tags" (Collection ids or names)
// to filter any newly attached event data handler.
// If the optional "tags" list (Collection ids or names) is specified,
// then all event handlers registered via the created hook will be
// triggered and called only if their event data origin matches the tags.
OnRecordAfterAuthWithOAuth2Request(tags ...string) *hook.TaggedHook[*RecordAuthWithOAuth2Event]
// OnRecordBeforeAuthRefreshRequest hook is triggered before each Record
@@ -456,15 +467,17 @@ type App interface {
// Could be used to additionally validate the request data or implement
// completely different auth refresh behavior (returning [hook.StopPropagation]).
//
// You can optionally specify a list of "tags" (Collection ids or names)
// to filter any newly attached event data handler.
// If the optional "tags" list (Collection ids or names) is specified,
// then all event handlers registered via the created hook will be
// triggered and called only if their event data origin matches the tags.
OnRecordBeforeAuthRefreshRequest(tags ...string) *hook.TaggedHook[*RecordAuthRefreshEvent]
// OnRecordAfterAuthRefreshRequest hook is triggered after each
// successful auth refresh API request (right after generating a new auth token).
//
// You can optionally specify a list of "tags" (Collection ids or names)
// to filter any newly attached event data handler.
// If the optional "tags" list (Collection ids or names) is specified,
// then all event handlers registered via the created hook will be
// triggered and called only if their event data origin matches the tags.
OnRecordAfterAuthRefreshRequest(tags ...string) *hook.TaggedHook[*RecordAuthRefreshEvent]
// OnRecordBeforeRequestPasswordResetRequest hook is triggered before each Record
@@ -473,15 +486,17 @@ type App interface {
// Could be used to additionally validate the request data or implement
// completely different password reset behavior (returning [hook.StopPropagation]).
//
// You can optionally specify a list of "tags" (Collection ids or names)
// to filter any newly attached event data handler.
// If the optional "tags" list (Collection ids or names) is specified,
// then all event handlers registered via the created hook will be
// triggered and called only if their event data origin matches the tags.
OnRecordBeforeRequestPasswordResetRequest(tags ...string) *hook.TaggedHook[*RecordRequestPasswordResetEvent]
// OnRecordAfterRequestPasswordResetRequest hook is triggered after each
// successful request password reset API request.
//
// You can optionally specify a list of "tags" (Collection ids or names)
// to filter any newly attached event data handler.
// If the optional "tags" list (Collection ids or names) is specified,
// then all event handlers registered via the created hook will be
// triggered and called only if their event data origin matches the tags.
OnRecordAfterRequestPasswordResetRequest(tags ...string) *hook.TaggedHook[*RecordRequestPasswordResetEvent]
// OnRecordBeforeConfirmPasswordResetRequest hook is triggered before each Record
@@ -490,15 +505,17 @@ type App interface {
// Could be used to additionally validate the request data or implement
// completely different persistence behavior (returning [hook.StopPropagation]).
//
// You can optionally specify a list of "tags" (Collection ids or names)
// to filter any newly attached event data handler.
// If the optional "tags" list (Collection ids or names) is specified,
// then all event handlers registered via the created hook will be
// triggered and called only if their event data origin matches the tags.
OnRecordBeforeConfirmPasswordResetRequest(tags ...string) *hook.TaggedHook[*RecordConfirmPasswordResetEvent]
// OnRecordAfterConfirmPasswordResetRequest hook is triggered after each
// successful confirm password reset API request.
//
// You can optionally specify a list of "tags" (Collection ids or names)
// to filter any newly attached event data handler.
// If the optional "tags" list (Collection ids or names) is specified,
// then all event handlers registered via the created hook will be
// triggered and called only if their event data origin matches the tags.
OnRecordAfterConfirmPasswordResetRequest(tags ...string) *hook.TaggedHook[*RecordConfirmPasswordResetEvent]
// OnRecordBeforeRequestVerificationRequest hook is triggered before each Record
@@ -507,15 +524,17 @@ type App interface {
// Could be used to additionally validate the loaded request data or implement
// completely different verification behavior (returning [hook.StopPropagation]).
//
// You can optionally specify a list of "tags" (Collection ids or names)
// to filter any newly attached event data handler.
// If the optional "tags" list (Collection ids or names) is specified,
// then all event handlers registered via the created hook will be
// triggered and called only if their event data origin matches the tags.
OnRecordBeforeRequestVerificationRequest(tags ...string) *hook.TaggedHook[*RecordRequestVerificationEvent]
// OnRecordAfterRequestVerificationRequest hook is triggered after each
// successful request verification API request.
//
// You can optionally specify a list of "tags" (Collection ids or names)
// to filter any newly attached event data handler.
// If the optional "tags" list (Collection ids or names) is specified,
// then all event handlers registered via the created hook will be
// triggered and called only if their event data origin matches the tags.
OnRecordAfterRequestVerificationRequest(tags ...string) *hook.TaggedHook[*RecordRequestVerificationEvent]
// OnRecordBeforeConfirmVerificationRequest hook is triggered before each Record
@@ -524,15 +543,17 @@ type App interface {
// Could be used to additionally validate the request data or implement
// completely different persistence behavior (returning [hook.StopPropagation]).
//
// You can optionally specify a list of "tags" (Collection ids or names)
// to filter any newly attached event data handler.
// If the optional "tags" list (Collection ids or names) is specified,
// then all event handlers registered via the created hook will be
// triggered and called only if their event data origin matches the tags.
OnRecordBeforeConfirmVerificationRequest(tags ...string) *hook.TaggedHook[*RecordConfirmVerificationEvent]
// OnRecordAfterConfirmVerificationRequest hook is triggered after each
// successful confirm verification API request.
//
// You can optionally specify a list of "tags" (Collection ids or names)
// to filter any newly attached event data handler.
// If the optional "tags" list (Collection ids or names) is specified,
// then all event handlers registered via the created hook will be
// triggered and called only if their event data origin matches the tags.
OnRecordAfterConfirmVerificationRequest(tags ...string) *hook.TaggedHook[*RecordConfirmVerificationEvent]
// OnRecordBeforeRequestEmailChangeRequest hook is triggered before each Record request email change API request
@@ -541,15 +562,17 @@ type App interface {
// Could be used to additionally validate the request data or implement
// completely different request email change behavior (returning [hook.StopPropagation]).
//
// You can optionally specify a list of "tags" (Collection ids or names)
// to filter any newly attached event data handler.
// If the optional "tags" list (Collection ids or names) is specified,
// then all event handlers registered via the created hook will be
// triggered and called only if their event data origin matches the tags.
OnRecordBeforeRequestEmailChangeRequest(tags ...string) *hook.TaggedHook[*RecordRequestEmailChangeEvent]
// OnRecordAfterRequestEmailChangeRequest hook is triggered after each
// successful request email change API request.
//
// You can optionally specify a list of "tags" (Collection ids or names)
// to filter any newly attached event data handler.
// If the optional "tags" list (Collection ids or names) is specified,
// then all event handlers registered via the created hook will be
// triggered and called only if their event data origin matches the tags.
OnRecordAfterRequestEmailChangeRequest(tags ...string) *hook.TaggedHook[*RecordRequestEmailChangeEvent]
// OnRecordBeforeConfirmEmailChangeRequest hook is triggered before each Record
@@ -558,23 +581,26 @@ type App interface {
// Could be used to additionally validate the request data or implement
// completely different persistence behavior (returning [hook.StopPropagation]).
//
// You can optionally specify a list of "tags" (Collection ids or names)
// to filter any newly attached event data handler.
// If the optional "tags" list (Collection ids or names) is specified,
// then all event handlers registered via the created hook will be
// triggered and called only if their event data origin matches the tags.
OnRecordBeforeConfirmEmailChangeRequest(tags ...string) *hook.TaggedHook[*RecordConfirmEmailChangeEvent]
// OnRecordAfterConfirmEmailChangeRequest hook is triggered after each
// successful confirm email change API request.
//
// You can optionally specify a list of "tags" (Collection ids or names)
// to filter any newly attached event data handler.
// If the optional "tags" list (Collection ids or names) is specified,
// then all event handlers registered via the created hook will be
// triggered and called only if their event data origin matches the tags.
OnRecordAfterConfirmEmailChangeRequest(tags ...string) *hook.TaggedHook[*RecordConfirmEmailChangeEvent]
// OnRecordListExternalAuthsRequest hook is triggered on each API record external auths list request.
//
// Could be used to validate or modify the response before returning it to the client.
//
// You can optionally specify a list of "tags" (Collection ids or names)
// to filter any newly attached event data handler.
// If the optional "tags" list (Collection ids or names) is specified,
// then all event handlers registered via the created hook will be
// triggered and called only if their event data origin matches the tags.
OnRecordListExternalAuthsRequest(tags ...string) *hook.TaggedHook[*RecordListExternalAuthsEvent]
// OnRecordBeforeUnlinkExternalAuthRequest hook is triggered before each API record
@@ -583,15 +609,17 @@ type App interface {
// Could be used to additionally validate the request data or implement
// completely different delete behavior (returning [hook.StopPropagation]).
//
// You can optionally specify a list of "tags" (Collection ids or names)
// to filter any newly attached event data handler.
// If the optional "tags" list (Collection ids or names) is specified,
// then all event handlers registered via the created hook will be
// triggered and called only if their event data origin matches the tags.
OnRecordBeforeUnlinkExternalAuthRequest(tags ...string) *hook.TaggedHook[*RecordUnlinkExternalAuthEvent]
// OnRecordAfterUnlinkExternalAuthRequest hook is triggered after each
// successful API record external auth unlink request.
//
// You can optionally specify a list of "tags" (Collection ids or names)
// to filter any newly attached event data handler.
// If the optional "tags" list (Collection ids or names) is specified,
// then all event handlers registered via the created hook will be
// triggered and called only if their event data origin matches the tags.
OnRecordAfterUnlinkExternalAuthRequest(tags ...string) *hook.TaggedHook[*RecordUnlinkExternalAuthEvent]
// ---------------------------------------------------------------
@@ -602,16 +630,18 @@ type App interface {
//
// Could be used to validate or modify the response before returning it to the client.
//
// You can optionally specify a list of "tags" (Collection ids or names)
// to filter any newly attached event data handler.
// If the optional "tags" list (Collection ids or names) is specified,
// then all event handlers registered via the created hook will be
// triggered and called only if their event data origin matches the tags.
OnRecordsListRequest(tags ...string) *hook.TaggedHook[*RecordsListEvent]
// OnRecordViewRequest hook is triggered on each API Record view request.
//
// Could be used to validate or modify the response before returning it to the client.
//
// You can optionally specify a list of "tags" (Collection ids or names)
// to filter any newly attached event data handler.
// If the optional "tags" list (Collection ids or names) is specified,
// then all event handlers registered via the created hook will be
// triggered and called only if their event data origin matches the tags.
OnRecordViewRequest(tags ...string) *hook.TaggedHook[*RecordViewEvent]
// OnRecordBeforeCreateRequest hook is triggered before each API Record
@@ -620,15 +650,17 @@ type App interface {
// Could be used to additionally validate the request data or implement
// completely different persistence behavior (returning [hook.StopPropagation]).
//
// You can optionally specify a list of "tags" (Collection ids or names)
// to filter any newly attached event data handler.
// If the optional "tags" list (Collection ids or names) is specified,
// then all event handlers registered via the created hook will be
// triggered and called only if their event data origin matches the tags.
OnRecordBeforeCreateRequest(tags ...string) *hook.TaggedHook[*RecordCreateEvent]
// OnRecordAfterCreateRequest hook is triggered after each
// successful API Record create request.
//
// You can optionally specify a list of "tags" (Collection ids or names)
// to filter any newly attached event data handler.
// If the optional "tags" list (Collection ids or names) is specified,
// then all event handlers registered via the created hook will be
// triggered and called only if their event data origin matches the tags.
OnRecordAfterCreateRequest(tags ...string) *hook.TaggedHook[*RecordCreateEvent]
// OnRecordBeforeUpdateRequest hook is triggered before each API Record
@@ -637,15 +669,17 @@ type App interface {
// Could be used to additionally validate the request data or implement
// completely different persistence behavior (returning [hook.StopPropagation]).
//
// You can optionally specify a list of "tags" (Collection ids or names)
// to filter any newly attached event data handler.
// If the optional "tags" list (Collection ids or names) is specified,
// then all event handlers registered via the created hook will be
// triggered and called only if their event data origin matches the tags.
OnRecordBeforeUpdateRequest(tags ...string) *hook.TaggedHook[*RecordUpdateEvent]
// OnRecordAfterUpdateRequest hook is triggered after each
// successful API Record update request.
//
// You can optionally specify a list of "tags" (Collection ids or names)
// to filter any newly attached event data handler.
// If the optional "tags" list (Collection ids or names) is specified,
// then all event handlers registered via the created hook will be
// triggered and called only if their event data origin matches the tags.
OnRecordAfterUpdateRequest(tags ...string) *hook.TaggedHook[*RecordUpdateEvent]
// OnRecordBeforeDeleteRequest hook is triggered before each API Record
@@ -654,15 +688,17 @@ type App interface {
// Could be used to additionally validate the request data or implement
// completely different delete behavior (returning [hook.StopPropagation]).
//
// You can optionally specify a list of "tags" (Collection ids or names)
// to filter any newly attached event data handler.
// If the optional "tags" list (Collection ids or names) is specified,
// then all event handlers registered via the created hook will be
// triggered and called only if their event data origin matches the tags.
OnRecordBeforeDeleteRequest(tags ...string) *hook.TaggedHook[*RecordDeleteEvent]
// OnRecordAfterDeleteRequest hook is triggered after each
// successful API Record delete request.
//
// You can optionally specify a list of "tags" (Collection ids or names)
// to filter any newly attached event data handler.
// If the optional "tags" list (Collection ids or names) is specified,
// then all event handlers registered via the created hook will be
// triggered and called only if their event data origin matches the tags.
OnRecordAfterDeleteRequest(tags ...string) *hook.TaggedHook[*RecordDeleteEvent]
// ---------------------------------------------------------------
@@ -1,6 +1,50 @@
<script>
import { slide } from "svelte/transition";
// svelte-ignore unused-export-let
export const key = "";
// svelte-ignore unused-export-let
export const options = {};
let showInfo = false;
</script>
<button
type="button"
class="inline-flex txt-sm flex-gap-5 link-hint"
on:click={() => {
showInfo = !showInfo;
}}
>
<strong class="txt">String value normalizations</strong>
{#if showInfo}
<i class="ri-arrow-up-s-line txt-sm" />
{:else}
<i class="ri-arrow-down-s-line txt-sm" />
{/if}
</button>
{#if showInfo}
<div class="block" transition:slide|local={{ duration: 150 }}>
<div class="alert alert-warning m-b-0 m-t-10">
<div class="content">
In order to support seamlessly both <code>application/json</code> and
<code>multipart/form-data</code>
requests, the following normalization rules are applied if the <code>json</code> field is a
<strong>plain string</strong>:
<ul>
<li>"true" is converted to the json <code>true</code></li>
<li>"false" is converted to the json <code>false</code></li>
<li>"null" is converted to the json <code>null</code></li>
<li>"[1,2,3]" is converted to the json <code>[1,2,3]</code></li>
<li>{'"{"a":1,"b":2}"'} is converted to the json <code>{'{"a":1,"b":2}'}</code></li>
<li>numeric strings are converted to json number</li>
<li>double quoted strings are left as they are (aka. without normalizations)</li>
<li>any other string (empty string too) is double quoted</li>
</ul>
Alternatively, if you don't want the string value normalizations, you can wrap your data inside
an object, eg.<code>{'{"data": anything}'}</code>
</div>
</div>
</div>
{/if}