/** * Retrieves the Swagger API declaration corresponding to a category of the * given Restlet Web API {@link Definition} * * @param definition * The Restlet Web API {@link Definition} * @param sectionName * The category of the API declaration * @return The Swagger {@link ApiDeclaration} of the given category */ public static ApiDeclaration getApiDeclaration(Definition definition, String sectionName) { ApiDeclaration result = new ApiDeclaration(); Contract contract = definition.getContract(); // fill API declaration main attributes fillApiDeclarationMainAttributes(definition, result); // fill API declaration resources Collection<String> usedModels = fillApiDeclarationResources(contract, result, sectionName); // fill API declaration representations fillApiDeclarationRepresentations(contract, result, usedModels); return result; }
/** * Retrieves the Swagger API declaration corresponding to a category of the * given Restlet Web API {@link Definition} * * @param definition * The Restlet Web API {@link Definition} * @param sectionName * The category of the API declaration * @return The Swagger {@link ApiDeclaration} of the given category */ public static ApiDeclaration getApiDeclaration(Definition definition, String sectionName) { ApiDeclaration result = new ApiDeclaration(); Contract contract = definition.getContract(); // fill API declaration main attributes fillApiDeclarationMainAttributes(definition, result); // fill API declaration resources Collection<String> usedModels = fillApiDeclarationResources(contract, result, sectionName); // fill API declaration representations fillApiDeclarationRepresentations(contract, result, usedModels); return result; }
/** * Retrieves the Swagger API declaration corresponding to a category of the * given Restlet Web API {@link Definition} * * @param definition * The Restlet Web API {@link Definition} * @param sectionName * The category of the API declaration * @return The Swagger {@link ApiDeclaration} of the given category */ public static ApiDeclaration getApiDeclaration(Definition definition, String sectionName) { ApiDeclaration result = new ApiDeclaration(); Contract contract = definition.getContract(); // fill API declaration main attributes fillApiDeclarationMainAttributes(definition, result); // fill API declaration resources Collection<String> usedModels = fillApiDeclarationResources(contract, result, sectionName); // fill API declaration representations fillApiDeclarationRepresentations(contract, result, usedModels); return result; }
/** * Retrieves the Swagger API declaration corresponding to a category of the * given Restlet Web API {@link Definition} * * @param definition * The Restlet Web API {@link Definition} * @param sectionName * The category of the API declaration * @return The Swagger {@link ApiDeclaration} of the given category */ public static ApiDeclaration getApiDeclaration(Definition definition, String sectionName) { ApiDeclaration result = new ApiDeclaration(); Contract contract = definition.getContract(); // fill API declaration main attributes fillApiDeclarationMainAttributes(definition, result); // fill API declaration resources Collection<String> usedModels = fillApiDeclarationResources(contract, result, sectionName); // fill API declaration representations fillApiDeclarationRepresentations(contract, result, usedModels); return result; }