All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.swagger.models.reader.ApiDeclarationReader Maven / Gradle / Ivy

There is a newer version: 1.0.71
Show newest version
package io.swagger.models.reader;

import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.swagger.models.apideclaration.ApiDeclaration;

import java.io.IOException;
import java.net.URL;

public class ApiDeclarationReader {
    public static void main(String[] args) throws IOException {
        ObjectMapper objectMapper = new ObjectMapper();
        objectMapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING);

        ApiDeclaration apiDeclaration = objectMapper.readValue(new URL("http://petstore.swagger.io/api/api-docs/store"), ApiDeclaration.class);

        System.out.println(apiDeclaration);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy