swagger-api / swagger-api/swagger-ui

Hierarchical Tags with laravel api

Open
#7,735 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Hello @kael-shipman. I have a problem with Hierarchical Tags in my laravel api. I can't make it work successfully. I make a screenshot and give all information i have. I don't know where is the problem exactly.
In console, this message appears:

Q&A (please complete the following information)
  • OS: Ubuntu 20.04
  • Browser: chrome
  • Method of installation: npm
  • Swagger-UI version: 3.10.0
  • Swagger/OpenAPI version: OpenAPI 3.0
Content & configuration

Swagger-UI configuration options:

SwaggerUI({
  dom_id: '#swagger-ui',

    url: "{!! $urlToDocs !!}",
    operationsSorter: {!! isset($operationsSorter) ? '"' . $operationsSorter . '"' : 'null' !!},
    configUrl: {!! isset($configUrl) ? '"' . $configUrl . '"' : 'null' !!},
    validatorUrl: {!! isset($validatorUrl) ? '"' . $validatorUrl . '"' : 'null' !!},
    oauth2RedirectUrl: "{{ route('l5-swagger.'.$documentation.'.oauth2_callback') }}",

    requestInterceptor: function(request) {
      request.headers['X-CSRF-TOKEN'] = '{{ csrf_token() }}';
      return request;
    },

    presets: [
      SwaggerUIBundle.presets.apis,
      SwaggerUIStandalonePreset
    ],

    plugins: [
      SwaggerUIBundle.plugins.DownloadUrl,
      HierarchicalTagsPlugin
    ],

    layout: "StandaloneLayout",

    persistAuthorization: {!! config('l5-swagger.defaults.persist_authorization') ? 'true' : 'false' !!},
})




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 the SwaggerUI configuration in the issue, especially the HierarchicalTagsPlugin entry and the unpkg asset request, using Swagger UI 3.10.0 in Chrome. Reproduce the console errors and check how the plugin is loaded in the Laravel API documentation page. Done means the plugin loads successfully and hierarchical tags work without the reported errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, laravel
Domain
api, documentation, frontend
Issue type
Bug
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.