Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
207204fe53 | ||
|
7618066b7f | ||
|
554e76ce51 | ||
|
2c51e9d929 |
@@ -5,8 +5,7 @@ publish-pypi:
|
||||
stage: package
|
||||
image: python:3.10
|
||||
script:
|
||||
- sed -i -e 's/1.12.1/${CI_COMMIT_TAG}/g' aiohttp_pydantic/__init__.py
|
||||
- cat aiohttp_pydantic/__init__.py
|
||||
- sed -i -e "s/1.12.1/${CI_COMMIT_TAG:1}/g" aiohttp_pydantic/__init__.py
|
||||
- pip install -U setuptools wheel pip; pip install invoke
|
||||
- invoke upload --pypi-user ${PYPI_REPO_USER} --pypi-password ${PYPI_REPO_PASSWORD} --pypi-url ${PYPI_REPO_URL}
|
||||
only:
|
||||
|
@@ -14,12 +14,13 @@ def setup(
|
||||
url_prefix: str = "/oas",
|
||||
enable: bool = True,
|
||||
version_spec: Optional[str] = None,
|
||||
title_spec: Optional[str] = None
|
||||
title_spec: Optional[str] = None,
|
||||
custom_template: Optional[jinja2.Template] = None
|
||||
):
|
||||
if enable:
|
||||
oas_app = web.Application()
|
||||
oas_app["apps to expose"] = tuple(apps_to_expose) or (app,)
|
||||
oas_app["index template"] = jinja2.Template(
|
||||
oas_app["index template"] = custom_template or jinja2.Template(
|
||||
resources.read_text("aiohttp_pydantic.oas", "index.j2")
|
||||
)
|
||||
oas_app["version_spec"] = version_spec
|
||||
|
@@ -1,45 +1,27 @@
|
||||
{# This updated file is part of swagger_ui_bundle (https://github.com/dtkav/swagger_ui_bundle) #}
|
||||
{# This updated file is part of swagger_ui_bundle (https://github.com/bartsanchez/swagger_ui_bundle) #}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>{{ title | default('Swagger UI') }}</title>
|
||||
<link rel="stylesheet" type="text/css" href="{{ static_url | trim('/') }}/swagger-ui.css" >
|
||||
<link rel="stylesheet" type="text/css" href="{{ static_url | trim('/') }}/swagger-ui.css" />
|
||||
<link rel="stylesheet" type="text/css" href="{{ static_url | trim('/') }}/index.css" />
|
||||
<link rel="icon" type="image/png" href="{{ static_url | trim('/') }}/favicon-32x32.png" sizes="32x32" />
|
||||
<link rel="icon" type="image/png" href="{{ static_url | trim('/') }}/favicon-16x16.png" sizes="16x16" />
|
||||
<style>
|
||||
html
|
||||
{
|
||||
box-sizing: border-box;
|
||||
overflow: -moz-scrollbars-vertical;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
*,
|
||||
*:before,
|
||||
*:after
|
||||
{
|
||||
box-sizing: inherit;
|
||||
}
|
||||
|
||||
body
|
||||
{
|
||||
margin:0;
|
||||
background: #fafafa;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="swagger-ui"></div>
|
||||
|
||||
<script src="{{ static_url | trim('/') }}/swagger-ui-bundle.js"> </script>
|
||||
<script src="{{ static_url | trim('/') }}/swagger-ui-standalone-preset.js"> </script>
|
||||
<script src="{{ static_url | trim('/') }}/swagger-ui-bundle.js" charset="UTF-8"> </script>
|
||||
<script src="{{ static_url | trim('/') }}/swagger-ui-standalone-preset.js" charset="UTF-8"> </script>
|
||||
<script>
|
||||
window.onload = function() {
|
||||
// Begin Swagger UI call region
|
||||
const ui = SwaggerUIBundle({
|
||||
url: "{{ openapi_spec_url }}",
|
||||
{% if urls is defined %}
|
||||
urls: {{ urls|tojson|safe }},
|
||||
{% endif %}
|
||||
validatorUrl: {{ validatorUrl | default('null') }},
|
||||
{% if configUrl is defined %}
|
||||
configUrl: "{{ configUrl }}",
|
||||
@@ -54,16 +36,15 @@
|
||||
SwaggerUIBundle.plugins.DownloadUrl
|
||||
],
|
||||
layout: "StandaloneLayout"
|
||||
})
|
||||
});
|
||||
{% if initOAuth is defined %}
|
||||
ui.initOAuth(
|
||||
{{ initOAuth|tojson|safe }}
|
||||
)
|
||||
{% endif %}
|
||||
// End Swagger UI call region
|
||||
|
||||
window.ui = ui
|
||||
}
|
||||
window.ui = ui;
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user