Twintipify your Spring Web MVC application. This library exposes all the endpoints TWINTIP requires. See the documentation for TWINTIP.
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"
You are done.
SchemaResource will send CORS Access-Control-* headers by default. You can disable this by setting twintip.cors property to false.
Host, port, schemes and basePath inside of the API definition can be overridden by setting property twintip.baseUrl to full base URL of API.
Copyright [2015] Zalando SE
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.