Skip to content

Commit b671b4e

Browse files
committed
For SpringDoc OpenAPI 1.6, Swagger UI unable to render definition. Fixes #52
1 parent 5d5c584 commit b671b4e

21 files changed

+199
-17
lines changed

docs/css/font-awesome.css

100644100755
File mode changed.

docs/faq.html

+26-1
Original file line numberDiff line numberDiff line change
@@ -1920,6 +1920,31 @@ <h3 id="_what_is_the_compatibility_matrix_of_springdoc_openapi_with_spring_boot"
19201920
<div class="paragraph">
19211921
<p>More precisely, this the exhaustive list of spring-boot versions against which <code>springdoc-openapi</code> has been built:</p>
19221922
</div>
1923+
</div>
1924+
<div class="sect2">
1925+
<h3 id="_i_am_getting_an_error_swagger_ui_unable_to_render_definition_when_overriding_the_default_spring_registered_httpmessageconverter"><a class="anchor" href="#_i_am_getting_an_error_swagger_ui_unable_to_render_definition_when_overriding_the_default_spring_registered_httpmessageconverter"></a>I am getting an error, Swagger UI unable to render definition, when overriding the default spring registered HttpMessageConverter?</h3>
1926+
<div class="paragraph">
1927+
<p>When overriding the default spring-boot registered <code>HttpMessageConverter</code>, you should have <code>ByteArrayHttpMessageConverter</code> registered as well to have proper <code>springdoc-openapi</code> support.</p>
1928+
</div>
1929+
<div class="listingblock">
1930+
<div class="content">
1931+
<pre class="highlight"><code class="language-java" data-lang="java"> converters.add(new ByteArrayHttpMessageConverter());
1932+
converters.add(new MappingJackson2HttpMessageConverter(jacksonBuilder.build()));
1933+
</code></pre>
1934+
</div>
1935+
</div>
1936+
<div class="admonitionblock note">
1937+
<table>
1938+
<tr>
1939+
<td class="icon">
1940+
<i class="fa icon-note" title="Note"></i>
1941+
</td>
1942+
<td class="content">
1943+
Order is very important, when registering <code>HttpMessageConverters</code>.
1944+
</td>
1945+
</tr>
1946+
</table>
1947+
</div>
19231948
<table class="tableblock frame-all grid-all stretch">
19241949
<colgroup>
19251950
<col style="width: 50%;">
@@ -1972,7 +1997,7 @@ <h3 id="_what_is_the_compatibility_matrix_of_springdoc_openapi_with_spring_boot"
19721997
</div>
19731998
<div id="footer">
19741999
<div id="footer-text">
1975-
Last updated 2023-03-07 21:59:39 +0100
2000+
Last updated 2023-05-01 19:28:36 +0200
19762001
</div>
19772002
</div>
19782003
</div>

docs/fonts/FontAwesome.otf

100644100755
File mode changed.

docs/fonts/fontawesome-webfont.eot

100644100755
File mode changed.

docs/fonts/fontawesome-webfont.svg

100644100755
File mode changed.

docs/fonts/fontawesome-webfont.ttf

100644100755
File mode changed.

docs/fonts/fontawesome-webfont.woff

100644100755
File mode changed.

docs/fonts/fontawesome-webfont.woff2

100644100755
File mode changed.

docs/index.html

+26
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ <h1>springdoc-openapi v1.7.0</h1>
194194
<li><a href="#how-can-i-define-different-description-for-a-class-attribute-depending-on-usage">12.76. How can i define different description for a class attribute depending on usage?</a></li>
195195
<li><a href="#customizing-swagger-static-resources">12.77. Customizing swagger static resources</a></li>
196196
<li><a href="#what-is-the-compatibility-matrix-of-springdoc-openapi-with-spring-boot">12.78. What is the compatibility matrix of <code>springdoc-openapi</code> with <code>spring-boot</code> ?</a></li>
197+
<li><a href="#i-am-getting-an-error-swagger-ui-unable-to-render-definition-when-overriding-the-default-spring-registered-httpmessageconverter">12.79. I am getting an error, Swagger UI unable to render definition, when overriding the default spring registered HttpMessageConverter?</a></li>
197198
</ul>
198199
</li>
199200
</ul>
@@ -4255,6 +4256,31 @@ <h3 id="what-is-the-compatibility-matrix-of-springdoc-openapi-with-spring-boot">
42554256
<div class="paragraph">
42564257
<p>More precisely, this the exhaustive list of spring-boot versions against which <code>springdoc-openapi</code> has been built:</p>
42574258
</div>
4259+
</div>
4260+
<div class="sect2">
4261+
<h3 id="i-am-getting-an-error-swagger-ui-unable-to-render-definition-when-overriding-the-default-spring-registered-httpmessageconverter"><a class="anchor" href="#i-am-getting-an-error-swagger-ui-unable-to-render-definition-when-overriding-the-default-spring-registered-httpmessageconverter"></a>12.79. I am getting an error, Swagger UI unable to render definition, when overriding the default spring registered HttpMessageConverter?</h3>
4262+
<div class="paragraph">
4263+
<p>When overriding the default spring-boot registered <code>HttpMessageConverter</code>, you should have <code>ByteArrayHttpMessageConverter</code> registered as well to have proper <code>springdoc-openapi</code> support.</p>
4264+
</div>
4265+
<div class="listingblock">
4266+
<div class="content">
4267+
<pre class="highlight"><code class="language-java" data-lang="java"> converters.add(new ByteArrayHttpMessageConverter());
4268+
converters.add(new MappingJackson2HttpMessageConverter(jacksonBuilder.build()));
4269+
</code></pre>
4270+
</div>
4271+
</div>
4272+
<div class="admonitionblock note">
4273+
<table>
4274+
<tr>
4275+
<td class="icon">
4276+
<i class="fa icon-note" title="Note"></i>
4277+
</td>
4278+
<td class="content">
4279+
Order is very important, when registering <code>HttpMessageConverters</code>.
4280+
</td>
4281+
</tr>
4282+
</table>
4283+
</div>
42584284
<table class="tableblock frame-all grid-all stretch">
42594285
<colgroup>
42604286
<col style="width: 50%;">

docs/v2/css/font-awesome.css

100644100755
File mode changed.

docs/v2/faq.html

+26-1
Original file line numberDiff line numberDiff line change
@@ -1832,6 +1832,31 @@ <h3 id="_what_is_the_compatibility_matrix_of_springdoc_openapi_with_spring_boot"
18321832
<div class="paragraph">
18331833
<p>More precisely, this the exhaustive list of spring-boot versions against which <code>springdoc-openapi</code> has been built:</p>
18341834
</div>
1835+
</div>
1836+
<div class="sect2">
1837+
<h3 id="_i_am_getting_an_error_swagger_ui_unable_to_render_definition_when_overriding_the_default_spring_registered_httpmessageconverter"><a class="anchor" href="#_i_am_getting_an_error_swagger_ui_unable_to_render_definition_when_overriding_the_default_spring_registered_httpmessageconverter"></a>I am getting an error, Swagger UI unable to render definition, when overriding the default spring registered HttpMessageConverter?</h3>
1838+
<div class="paragraph">
1839+
<p>When overriding the default spring-boot registered <code>HttpMessageConverter</code>, you should have <code>ByteArrayHttpMessageConverter</code> registered as well to have proper <code>springdoc-openapi</code> support.</p>
1840+
</div>
1841+
<div class="listingblock">
1842+
<div class="content">
1843+
<pre class="highlight"><code class="language-java" data-lang="java"> converters.add(new ByteArrayHttpMessageConverter());
1844+
converters.add(new MappingJackson2HttpMessageConverter(jacksonBuilder.build()));
1845+
</code></pre>
1846+
</div>
1847+
</div>
1848+
<div class="admonitionblock note">
1849+
<table>
1850+
<tr>
1851+
<td class="icon">
1852+
<i class="fa icon-note" title="Note"></i>
1853+
</td>
1854+
<td class="content">
1855+
Order is very important, when registering <code>HttpMessageConverters</code>.
1856+
</td>
1857+
</tr>
1858+
</table>
1859+
</div>
18351860
<table class="tableblock frame-all grid-all stretch">
18361861
<colgroup>
18371862
<col style="width: 50%;">
@@ -1884,7 +1909,7 @@ <h3 id="_what_is_the_compatibility_matrix_of_springdoc_openapi_with_spring_boot"
18841909
</div>
18851910
<div id="footer">
18861911
<div id="footer-text">
1887-
Last updated 2023-04-02 01:12:58 +0200
1912+
Last updated 2023-05-01 19:28:25 +0200
18881913
</div>
18891914
</div>
18901915
</div>

docs/v2/fonts/FontAwesome.otf

100644100755
File mode changed.

docs/v2/fonts/fontawesome-webfont.eot

100644100755
File mode changed.

docs/v2/fonts/fontawesome-webfont.svg

100644100755
File mode changed.

docs/v2/fonts/fontawesome-webfont.ttf

100644100755
File mode changed.

docs/v2/fonts/fontawesome-webfont.woff

100644100755
File mode changed.

docs/v2/fonts/fontawesome-webfont.woff2

100644100755
File mode changed.

docs/v2/index.html

+26
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ <h1>springdoc-openapi v2.1.0</h1>
183183
<li><a href="#customizing-swagger-static-resources">13.76. Customizing swagger static resources</a></li>
184184
<li><a href="#is-graalvm-supported">13.77. Is GraalVM supported ?</a></li>
185185
<li><a href="#what-is-the-compatibility-matrix-of-springdoc-openapi-with-spring-boot">13.78. What is the compatibility matrix of <code>springdoc-openapi</code> with <code>spring-boot</code> ?</a></li>
186+
<li><a href="#i-am-getting-an-error-swagger-ui-unable-to-render-definition-when-overriding-the-default-spring-registered-httpmessageconverter">13.79. I am getting an error, Swagger UI unable to render definition, when overriding the default spring registered HttpMessageConverter?</a></li>
186187
</ul>
187188
</li>
188189
</ul>
@@ -4420,6 +4421,31 @@ <h3 id="what-is-the-compatibility-matrix-of-springdoc-openapi-with-spring-boot">
44204421
<div class="paragraph">
44214422
<p>More precisely, this the exhaustive list of spring-boot versions against which <code>springdoc-openapi</code> has been built:</p>
44224423
</div>
4424+
</div>
4425+
<div class="sect2">
4426+
<h3 id="i-am-getting-an-error-swagger-ui-unable-to-render-definition-when-overriding-the-default-spring-registered-httpmessageconverter"><a class="anchor" href="#i-am-getting-an-error-swagger-ui-unable-to-render-definition-when-overriding-the-default-spring-registered-httpmessageconverter"></a>13.79. I am getting an error, Swagger UI unable to render definition, when overriding the default spring registered HttpMessageConverter?</h3>
4427+
<div class="paragraph">
4428+
<p>When overriding the default spring-boot registered <code>HttpMessageConverter</code>, you should have <code>ByteArrayHttpMessageConverter</code> registered as well to have proper <code>springdoc-openapi</code> support.</p>
4429+
</div>
4430+
<div class="listingblock">
4431+
<div class="content">
4432+
<pre class="highlight"><code class="language-java" data-lang="java"> converters.add(new ByteArrayHttpMessageConverter());
4433+
converters.add(new MappingJackson2HttpMessageConverter(jacksonBuilder.build()));
4434+
</code></pre>
4435+
</div>
4436+
</div>
4437+
<div class="admonitionblock note">
4438+
<table>
4439+
<tr>
4440+
<td class="icon">
4441+
<i class="fa icon-note" title="Note"></i>
4442+
</td>
4443+
<td class="content">
4444+
Order is very important, when registering <code>HttpMessageConverters</code>.
4445+
</td>
4446+
</tr>
4447+
</table>
4448+
</div>
44234449
<table class="tableblock frame-all grid-all stretch">
44244450
<colgroup>
44254451
<col style="width: 50%;">

src/docs/asciidoc/faq.adoc

+10
Original file line numberDiff line numberDiff line change
@@ -1005,6 +1005,16 @@ In general, **you should only pick the last stable version as per today {springd
10051005

10061006
More precisely, this the exhaustive list of spring-boot versions against which `springdoc-openapi` has been built:
10071007

1008+
=== I am getting an error, Swagger UI unable to render definition, when overriding the default spring registered HttpMessageConverter?
1009+
When overriding the default spring-boot registered `HttpMessageConverter`, you should have `ByteArrayHttpMessageConverter` registered as well to have proper `springdoc-openapi` support.
1010+
1011+
[source,java]
1012+
----
1013+
converters.add(new ByteArrayHttpMessageConverter());
1014+
converters.add(new MappingJackson2HttpMessageConverter(jacksonBuilder.build()));
1015+
----
1016+
NOTE: Order is very important, when registering `HttpMessageConverters`.
1017+
10081018
|===
10091019
| spring-boot Versions | Minimum springdoc-openapi Versions
10101020

src/docs/asciidoc/sitemap.xml

+75-15
Original file line numberDiff line numberDiff line change
@@ -2,62 +2,122 @@
22
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
33
<url>
44
<loc>https://springdoc.org/</loc>
5-
<lastmod>2022-10-23</lastmod>
5+
<lastmod>2022-11-24</lastmod>
66
</url>
77
<url>
88
<loc>https://springdoc.org/index.html</loc>
9-
<lastmod>2022-10-23</lastmod>
9+
<lastmod>2022-11-24</lastmod>
1010
</url>
1111
<url>
1212
<loc>https://springdoc.org/core-properties.html</loc>
13-
<lastmod>2022-10-23</lastmod>
13+
<lastmod>2022-11-24</lastmod>
1414
</url>
1515
<url>
1616
<loc>https://springdoc.org/demos.html</loc>
17-
<lastmod>2022-10-23</lastmod>
17+
<lastmod>2022-11-24</lastmod>
1818
</url>
1919
<url>
2020
<loc>https://springdoc.org/faq.html</loc>
21-
<lastmod>2022-10-23</lastmod>
21+
<lastmod>2022-11-24</lastmod>
2222
</url>
2323
<url>
2424
<loc>https://springdoc.org/features.html</loc>
25-
<lastmod>2022-10-23</lastmod>
25+
<lastmod>2022-11-24</lastmod>
2626
</url>
2727
<url>
2828
<loc>https://springdoc.org/getting-started.html</loc>
29-
<lastmod>2022-10-23</lastmod>
29+
<lastmod>2022-11-24</lastmod>
3030
</url>
3131
<url>
3232
<loc>https://springdoc.org/intro.html</loc>
33-
<lastmod>2022-10-23</lastmod>
33+
<lastmod>2022-11-24</lastmod>
3434
</url>
3535
<url>
3636
<loc>https://springdoc.org/migrating-from-springfox.html</loc>
37-
<lastmod>2022-10-23</lastmod>
37+
<lastmod>2022-11-24</lastmod>
3838
</url>
3939
<url>
4040
<loc>https://springdoc.org/modules.html</loc>
41-
<lastmod>2022-10-23</lastmod>
41+
<lastmod>2022-11-24</lastmod>
4242
</url>
4343
<url>
4444
<loc>https://springdoc.org/other-resources.html</loc>
45-
<lastmod>2022-10-23</lastmod>
45+
<lastmod>2022-11-24</lastmod>
4646
</url>
4747
<url>
4848
<loc>https://springdoc.org/plugins.html</loc>
49-
<lastmod>2022-10-23</lastmod>
49+
<lastmod>2022-11-24</lastmod>
5050
</url>
5151
<url>
5252
<loc>https://springdoc.org/properties.html</loc>
53-
<lastmod>2022-10-23</lastmod>
53+
<lastmod>2022-11-24</lastmod>
5454
</url>
5555
<url>
5656
<loc>https://springdoc.org/ui-properties.html</loc>
57-
<lastmod>2022-10-23</lastmod>
57+
<lastmod>2022-11-24</lastmod>
5858
</url>
5959
<url>
6060
<loc>https://springdoc.org/thanks.html</loc>
61-
<lastmod>2022-10-23</lastmod>
61+
<lastmod>2022-11-24</lastmod>
62+
</url>
63+
<url>
64+
<loc>https://springdoc.org/v2</loc>
65+
<lastmod>2022-11-24</lastmod>
66+
</url>
67+
<url>
68+
<loc>https://springdoc.org/v2/index.html</loc>
69+
<lastmod>2022-11-24</lastmod>
70+
</url>
71+
<url>
72+
<loc>https://springdoc.org/v2/core-properties.html</loc>
73+
<lastmod>2022-11-24</lastmod>
74+
</url>
75+
<url>
76+
<loc>https://springdoc.org/v2/demos.html</loc>
77+
<lastmod>2022-11-24</lastmod>
78+
</url>
79+
<url>
80+
<loc>https://springdoc.org/v2/faq.html</loc>
81+
<lastmod>2022-11-24</lastmod>
82+
</url>
83+
<url>
84+
<loc>https://springdoc.org/v2/features.html</loc>
85+
<lastmod>2022-11-24</lastmod>
86+
</url>
87+
<url>
88+
<loc>https://springdoc.org/v2/getting-started.html</loc>
89+
<lastmod>2022-11-24</lastmod>
90+
</url>
91+
<url>
92+
<loc>https://springdoc.org/v2/intro.html</loc>
93+
<lastmod>2022-11-24</lastmod>
94+
</url>
95+
<url>
96+
<loc>https://springdoc.org/v2/migrating-from-springfox.html</loc>
97+
<lastmod>2022-11-24</lastmod>
98+
</url>
99+
<url>
100+
<loc>https://springdoc.org/v2/modules.html</loc>
101+
<lastmod>2022-11-24</lastmod>
102+
</url>
103+
<url>
104+
<loc>https://springdoc.org/v2/other-resources.html</loc>
105+
<lastmod>2022-11-24</lastmod>
106+
</url>
107+
<url>
108+
<loc>https://springdoc.org/v2/plugins.html</loc>
109+
<lastmod>2022-11-24</lastmod>
110+
</url>
111+
<url>
112+
<loc>https://springdoc.org/v2/properties.html</loc>
113+
<lastmod>2022-11-24</lastmod>
114+
</url>
115+
<url>
116+
<loc>https://springdoc.org/v2/ui-properties.html</loc>
117+
<lastmod>2022-11-24</lastmod>
118+
</url>
119+
<url>
120+
<loc>https://springdoc.org/v2/thanks.html</loc>
121+
<lastmod>2022-11-24</lastmod>
62122
</url>
63123
</urlset>

src/docs/asciidoc/v2/faq.adoc

+10
Original file line numberDiff line numberDiff line change
@@ -934,6 +934,16 @@ In general, **you should only pick the last stable version as per today 2.1.0.**
934934

935935
More precisely, this the exhaustive list of spring-boot versions against which `springdoc-openapi` has been built:
936936

937+
=== I am getting an error, Swagger UI unable to render definition, when overriding the default spring registered HttpMessageConverter?
938+
When overriding the default spring-boot registered `HttpMessageConverter`, you should have `ByteArrayHttpMessageConverter` registered as well to have proper `springdoc-openapi` support.
939+
940+
[source,java]
941+
----
942+
converters.add(new ByteArrayHttpMessageConverter());
943+
converters.add(new MappingJackson2HttpMessageConverter(jacksonBuilder.build()));
944+
----
945+
NOTE: Order is very important, when registering `HttpMessageConverters`.
946+
937947
|===
938948
| spring-boot Versions | Minimum springdoc-openapi Versions
939949

0 commit comments

Comments
 (0)