What is the purpose of the io.smallrye:smallrye-open-api-spring artifact? #1870
-
Is the io.smallrye/smallrye-open-api-spring artifact intended to be an OpenAPI specification generator for Spring Boot, similar to how io.quarkus/quarkus-smallrye-openapi works for Quarkus? If so, how do you use it? If given some pointers, I'm willing to work on a tutorial like this one and work towards making it available on Spring Initializr. I've only managed to get the following output: # target/generated/openapi.yaml
---
openapi: 3.0.3
info:
title: Generated API
version: "1.0"
paths:
/api/hello:
get:
summary: Hello endpoint
description: Returns a greeting message
responses:
"200":
description: OK
content:
'*/*':
schema:
type: string To do that, I created a sample Spring Boot project: mkdir sample
cd sample
curl https://start.spring.io/starter.zip \
-d type=maven-project \
-d dependencies=web \
-o sample.zip
unzip sample.zip Then added the following to the pom.xml: <dependency>
<groupId>io.smallrye</groupId>
<artifactId>smallrye-open-api-spring</artifactId>
<version>3.11.0</version>
</dependency>
<dependency>
<groupId>io.smallrye</groupId>
<artifactId>smallrye-open-api-maven-plugin</artifactId>
<version>3.11.0</version>
</dependency> And ran: ./mvnw io.smallrye:smallrye-open-api-maven-plugin:generate-schema However, unlike its Quarkus equivalent, all the following endpoints returned 1 . http://localhost:8080/openapi Getting it to work on spring-projects/spring-petclinic is the next step. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
No, the io.smallrye/smallrye-open-api-spring artifactis intended to be an OpenAPI specification generator for Spring support in Quarkus. |
Beta Was this translation helpful? Give feedback.
No, the io.smallrye/smallrye-open-api-spring artifactis intended to be an OpenAPI specification generator for Spring support in Quarkus.