Skip to content

Commit

Permalink
Merge pull request micronaut-projects#937 from altro3/rapidoc_fix
Browse files Browse the repository at this point in the history
Allow POST requests for rapidoc
  • Loading branch information
graemerocher authored Mar 2, 2023
2 parents 582a523 + 11c261b commit e0de343
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions openapi/src/main/resources/templates/rapidoc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{{rapipdf.script}}
</head>
<script>
window.addEventListener('DOMContentLoaded', (event) => {
window.addEventListener('DOMContentLoaded', () => {
const docEl = document.getElementById('rapidoc');
docEl.addEventListener('before-try', (e) => {
e.detail.request.headers.append('AAA-BBB', 'CCC DDDD');
Expand All @@ -34,16 +34,6 @@
}
rapidoc.setAttribute('spec-url', contextPath + '{{specURL}}');
{{rapipdf.specurl}}
document.addEventListener('DOMContentLoaded', (event) => {
let docEl = document.getElementById("rapidoc");

// 2. before-try (Aborts all post calls)
docEl.addEventListener('before-try', (e) => {
if (e.detail.request.method === 'POST') {
e.detail.controller.abort();
}
});
})
</script>
</body>
</html>

0 comments on commit e0de343

Please sign in to comment.