Skip to content

Commit

Permalink
refactor: expose swagger instance to upstream apps (#1250)
Browse files Browse the repository at this point in the history
Co-authored-by: Kong UI Bot <[email protected]>
  • Loading branch information
andrewwylde and kongponents-bot authored Mar 20, 2024
1 parent b54f470 commit d9cd89f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/portal/spec-renderer/src/components/SpecDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ const { i18n } = composables.useI18n()
const swaggerRef = ref<SwaggerUIElement | null>(null)
defineExpose({
swaggerInstance: swaggerRef,
})
const hasRequiredProps = computed((): boolean => {
return !!(props.document || props.url)
})
Expand Down
4 changes: 4 additions & 0 deletions packages/portal/swagger-ui-web-component/src/element.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,10 @@ export class SwaggerUIElement extends HTMLElement {
this.#essentialsOnly = attributeValueToBoolean(essentialsOnly)
}

get instance() {
return this.#instance
}

get spec() {
return this.#spec
}
Expand Down

0 comments on commit d9cd89f

Please sign in to comment.