创建了庞大的文件后,尝试访问页面时,Drupal 8 Swagger UI格式化程序获取/网络/架构错误

时间:2018-07-25 16:50:20

标签: api drupal swagger drupal-8 swagger-ui

我想使用swagger UI记录我的api。我不知道为什么会发生这个问题。我认为这是由于我试图禁用ValidationURL引起的(不知道我是否正确执行。请提供步骤,如果您知道)

使用版本:

  • Drupal 8.5.3
  • Swagger UI Formatter- 8.x-2.0
  • Swagger UI库-尝试过Swagger UI 3.17.5和Swagger-UI 3.17.3-没有帮助

以下说明:-https://www.drupal.org/docs/8/modules/apigee-edge/document-your-apis-usi ...-https://ftp.drupal.org/files/projects/swagger_ui_formatter-8.x-2.0.zip->阅读我swagger_ui_formatter.zip文件中的文件

收到错误:

Fetch error NetworkError when attempting to fetch resource. https://assets/2018-07/DrugAPI_v1_7-16-18.json Fetch error Possible cross-origin (CORS) issue? The URL origin (https://assets) does not match the page (http://localhost). Check the server returns the correct 'Access-Control-Allow-*' headers.

{"schemaValidationMessages":[{"level":"error","message":"Can't read from file https://assets/2018-07/DrugAPI_v1_7-16-18.json"}]}

控制台错误日志:

Refused to execute script from 'http://localhost/developer-portal/htdocs/libraries/swagger_ui/dist/swagger-ui-bundle.js?v=8.5.3' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.

Refused to execute script from 'http://localhost/developer-portal/htdocs/libraries/swagger_ui/dist/swagger-ui-standalone-preset.js?v=8.5.3' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.

Uncaught ReferenceError: SwaggerUIBundle is not defined

Refused to apply style from 'http://localhost/developer-portal/htdocs/libraries/swagger_ui/dist/swagger-ui.css?pce4zt' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

屏幕截图:

fetch or network or schema error - swagger ui formatter drupal 8

0 个答案:

没有答案