The project is no longer maintained. Consider to use alternatives, e.g. springdoc.
Twintipify your Spring Web MVC application. This library exposes your API schema at /.well-known/schema-discovery
as specified in our RESTful API Guidelines. Twintip was the former API crawler that was tasked with finding and indexing API schemas, hence the name of this library.
- never think about your Twintip-compatible schema discovery endpoint ever again
- Java 11
- Any build tool using Maven Central, or direct download
- Servlet Container
- Spring
Add the following dependency to your project:
<dependency>
<groupId>org.zalando</groupId>
<artifactId>twintip-spring-web</artifactId>
<version>${twintip-spring-web.version}</version>
</dependency>
First make sure that the endpoints are mapped into your application.
import org.zalando.twintip.spring.SchemaResource;
@Configuration
@Import(SchemaResource.class)
public class YourConfigration {
// whatever you configure
}
Next you need to provide the API definition and decide where clients should find it. You can do this in your application.properties or application.yml.
twintip:
mapping: /api
yaml: "classpath:api.yml"
SchemaResource will send CORS Access-Control-* headers by default. You can disable this by setting twintip.cors
property to false.
Host, port, schemes and base path inside of the API definition can be overridden by setting the twintip.baseUrl
property to full base URL of API.
If you have questions, concerns, bug reports, etc., please file an issue in this repository's Issue Tracker.
To contribute, simply make a pull request and add a brief description (1-2 sentences) of your addition or change. For more details, check the contribution guidelines.