Skip to content

Commit

Permalink
Allow setting boolean values to string(false).
Browse files Browse the repository at this point in the history
  • Loading branch information
wparad committed Sep 3, 2023
1 parent 4629e17 commit 27f9c59
Showing 1 changed file with 48 additions and 8 deletions.
56 changes: 48 additions & 8 deletions src/openapi-explorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ export default class OpenApiExplorer extends LitElement {
// UI Layouts
layout: { type: String },

collapsed: { type: Boolean, attribute: 'collapse' },
collapsed: {
type: Boolean, attribute: 'collapse',
converter(value) {
return value === 'false' ? false : value;
}
},
operationsCollapsed: { type: Boolean },
componentsCollapsed: { type: Boolean },

Expand All @@ -60,20 +65,50 @@ export default class OpenApiExplorer extends LitElement {
fillRequestWithDefault: { type: String, attribute: 'fill-defaults' },

// Schema Styles
displaySchemaAsTable: { type: Boolean, attribute: 'table' },
displaySchemaAsTable: {
type: Boolean, attribute: 'table',
converter(value) {
return value === 'false' ? false : value;
}
},
schemaExpandLevel: { type: Number, attribute: 'schema-expand-level' },

// API Server
serverUrl: { type: String, attribute: 'server-url' },

// Hide/Show Sections & Enable Disable actions
showInfo: { type: String, attribute: 'show-info' },
hideAuthentication: { type: Boolean, attribute: 'hide-authentication' },
hideAuthentication: {
type: Boolean, attribute: 'hide-authentication',
converter(value) {
return value === 'false' ? false : value;
}
},
allowTry: { type: String, attribute: 'enable-console' },
includeNulls: { type: Boolean, attribute: 'display-nulls' },
hideSearch: { type: Boolean, attribute: 'hide-search' },
hideServerSelection: { type: Boolean, attribute: 'hide-server-selection' },
hideComponents: { type: Boolean, attribute: 'hide-components' },
includeNulls: {
type: Boolean, attribute: 'display-nulls',
converter(value) {
return value === 'false' ? false : value;
}
},
hideSearch: {
type: Boolean, attribute: 'hide-search',
converter(value) {
return value === 'false' ? false : value;
}
},
hideServerSelection: {
type: Boolean, attribute: 'hide-server-selection',
converter(value) {
return value === 'false' ? false : value;
}
},
hideComponents: {
type: Boolean, attribute: 'hide-components',
converter(value) {
return value === 'false' ? false : value;
}
},

// Main Colors and Font
primaryColor: { type: String, attribute: 'primary-color' },
Expand All @@ -89,7 +124,12 @@ export default class OpenApiExplorer extends LitElement {
navHoverBgColor: { type: String, attribute: 'nav-hover-bg-color' },
navHoverTextColor: { type: String, attribute: 'nav-hover-text-color' },
navItemSpacing: { type: String, attribute: 'nav-item-spacing' },
usePathInNavBar: { type: Boolean, attribute: 'use-path-in-nav-bar' },
usePathInNavBar: {
type: Boolean, attribute: 'use-path-in-nav-bar',
converter(value) {
return value === 'false' ? false : value;
}
},

// Fetch Options
fetchCredentials: { type: String, attribute: 'fetch-credentials' },
Expand Down

0 comments on commit 27f9c59

Please sign in to comment.