swagger-api / swagger-api/swagger-ui

How to import function from the utils.js ?

Open
#5,053 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: support
Dominant language
JavaScript
Stars
29k
Forks
9.3k
Avg merge
2d 23h
Merged PRs (30d)
25

Description

Hi all,

I'm customising swagger for a project with React and Swagger-ui.
I have imported Swagger in a new react-app like this :

import SwaggerUI from 'swagger-ui'

I'm creating components or customising by overwriting some of them but when I need function from the core/utils.js the function can not be found...

For example, I want to use the function getSampleSchema by doing :

import {getSampleSchema} from "swagger-ui" or import {getSampleSchema} from "core/utils"

is not working. Do you know how I can do that ? Or if there is a better way to customise the components ?

Thanks

Configuration :
React : 16.4.1
Swagger : 3.17.2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with core/utils.js and the package entry point used by import SwaggerUI from "swagger-ui". Check whether getSampleSchema is intended to be publicly importable and compare that with the documented component-customization path. Done means the supported import or customization approach is established and verified in the stated React and Swagger UI versions.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.