File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,6 +37,12 @@ void infersApplicationYamlForYamlExtension() {
3737 .isEqualTo ("application/yaml" );
3838 }
3939
40+ @ Test
41+ void infersApplicationYamlForYmlExtension () {
42+ assertThat (new ClasspathResourceHandler ("/openapi.yml" ).contentType ())
43+ .isEqualTo ("application/yaml" );
44+ }
45+
4046 @ Test
4147 void infersTextPlainForTxtExtension () {
4248 assertThat (new ClasspathResourceHandler ("/sample.txt" ).contentType ())
Original file line number Diff line number Diff line change @@ -31,6 +31,16 @@ void loadsYamlSpecViaSnakeYaml() throws Exception {
3131 assertThat (spec .operations ()).isNotEmpty ();
3232 }
3333
34+ @ Test
35+ void loadsYmlSpecViaSnakeYaml () throws Exception {
36+ Path resource = Path .of (getClass ().getResource ("/openapi.yml" ).toURI ());
37+
38+ Spec spec = Spec .fromPath (resource );
39+
40+ assertThat (spec .openapi ()).startsWith ("3.1" );
41+ assertThat (spec .operations ()).isNotEmpty ();
42+ }
43+
3444 @ Test
3545 void rejectsUnknownExtension (@ TempDir Path tmp ) throws Exception {
3646 Path unknown = tmp .resolve ("spec.txt" );
You can’t perform that action at this time.
0 commit comments