Tabnine Logo
org.restlet.ext.platform.internal.conversion.swagger.v1_2
Code IndexAdd Tabnine to your IDE (free)

How to use org.restlet.ext.platform.internal.conversion.swagger.v1_2

Best Java code snippets using org.restlet.ext.platform.internal.conversion.swagger.v1_2 (Showing top 20 results out of 315)

origin: org.restlet.jee/org.restlet.ext.platform

/**
 * 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}
 * @return The Swagger {@link ApiDeclaration} of the given category
 */
public static ApiDeclaration getApiDeclaration(Definition definition) {
  return getApiDeclaration(definition, null);
}
origin: org.restlet.osgi/org.restlet.ext.platform

  /**
   * Translates a Restlet Web API Definition to a Swagger resource listing.
   * 
   * @param definition
   *            The Restlet Web API Definition.
   * @return The corresponding resource listing
   */
  public static ResourceListing getResourcelisting(Definition definition) {
    ResourceListing result = new ResourceListing();

    // fill resource listing main attributes
    fillResourceListingMainAttributes(definition, result);

    // fill resource listing API list
    fillResourceListingApis(definition, result);

    return result;
  }
}
origin: org.restlet.jse/org.restlet.ext.platform

/**
 * 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;
}
origin: org.restlet.osgi/org.restlet.ext.platform

/**
 * Converts a Swagger parameter to an instance of
 * {@link org.restlet.ext.platform.internal.model.PathVariable}.
 * 
 * @param parameter
 *            The Swagger parameter.
 * @return An instance of
 *         {@link org.restlet.ext.platform.internal.model.PathVariable}.
 */
private static PathVariable toPathVariable(
    ResourceOperationParameterDeclaration parameter) {
  PathVariable result = new PathVariable();
  result.setName(parameter.getName());
  result.setDescription(parameter.getDescription());
  result.setType(SwaggerTypes.toDefinitionType(new SwaggerTypeFormat(
      parameter.getType(), parameter.getFormat())));
  return result;
}
origin: org.restlet.osgi/org.restlet.ext.platform

/**
 * Translates a Swagger Resource Listing to a Restlet definition.
 * 
 * @param listing
 *            The Swagger resource listing.
 * @return The Restlet definition.
 * @throws org.restlet.ext.platform.internal.conversion.TranslationException
 */
public static Definition translate(ResourceListing listing) {
  Definition definition = new Definition();
  fillMainAttributes(definition, listing, null);
  Contract contract = definition.getContract();
  fillSections(contract, listing);
  LOGGER.log(Level.FINE,
      "Main attributes successfully retrieved from Swagger resource listing.");
  return definition;
}
    
origin: org.restlet.jee/org.restlet.ext.platform

  return new SwaggerTypeFormat("string");
} else if ("byte".equals(dataType)) {
  return new SwaggerTypeFormat("string", "byte");
} else if ("short".equals(dataType)) {
  return new SwaggerTypeFormat("integer", "int32");
} else if ("integer".equals(dataType)) {
  return new SwaggerTypeFormat("integer", "int32");
} else if ("long".equals(dataType)) {
  return new SwaggerTypeFormat("integer", "int64");
} else if ("float".equals(dataType)) {
  return new SwaggerTypeFormat("number", "float");
} else if ("double".equals(dataType)) {
  return new SwaggerTypeFormat("number", "double");
} else if ("boolean".equals(dataType)) {
  return new SwaggerTypeFormat("boolean");
} else if ("date".equals(dataType)) {
  return new SwaggerTypeFormat("string", "date");
} else {
  return new SwaggerTypeFormat(dataType);
origin: org.restlet.jse/org.restlet.ext.platform

/**
 * Converts a Swagger parameter to an instance of
 * {@link org.restlet.ext.platform.internal.model.PathVariable}.
 * 
 * @param parameter
 *            The Swagger parameter.
 * @return An instance of
 *         {@link org.restlet.ext.platform.internal.model.PathVariable}.
 */
private static PathVariable toPathVariable(
    ResourceOperationParameterDeclaration parameter) {
  PathVariable result = new PathVariable();
  result.setName(parameter.getName());
  result.setDescription(parameter.getDescription());
  result.setType(SwaggerTypes.toDefinitionType(new SwaggerTypeFormat(
      parameter.getType(), parameter.getFormat())));
  return result;
}
origin: org.restlet.gae/org.restlet.ext.platform

  /**
   * Translates a Restlet Web API Definition to a Swagger resource listing.
   * 
   * @param definition
   *            The Restlet Web API Definition.
   * @return The corresponding resource listing
   */
  public static ResourceListing getResourcelisting(Definition definition) {
    ResourceListing result = new ResourceListing();

    // fill resource listing main attributes
    fillResourceListingMainAttributes(definition, result);

    // fill resource listing API list
    fillResourceListingApis(definition, result);

    return result;
  }
}
origin: org.restlet.gae/org.restlet.ext.platform

/**
 * 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;
}
origin: org.restlet.jse/org.restlet.ext.platform

/**
 * Translates a Swagger Resource Listing to a Restlet definition.
 * 
 * @param listing
 *            The Swagger resource listing.
 * @return The Restlet definition.
 * @throws org.restlet.ext.platform.internal.conversion.TranslationException
 */
public static Definition translate(ResourceListing listing) {
  Definition definition = new Definition();
  fillMainAttributes(definition, listing, null);
  Contract contract = definition.getContract();
  fillSections(contract, listing);
  LOGGER.log(Level.FINE,
      "Main attributes successfully retrieved from Swagger resource listing.");
  return definition;
}
    
origin: org.restlet.gae/org.restlet.ext.platform

/**
 * 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}
 * @return The Swagger {@link ApiDeclaration} of the given category
 */
public static ApiDeclaration getApiDeclaration(Definition definition) {
  return getApiDeclaration(definition, null);
}
origin: org.restlet.gae/org.restlet.ext.platform

  return new SwaggerTypeFormat("string");
} else if ("byte".equals(dataType)) {
  return new SwaggerTypeFormat("string", "byte");
} else if ("short".equals(dataType)) {
  return new SwaggerTypeFormat("integer", "int32");
} else if ("integer".equals(dataType)) {
  return new SwaggerTypeFormat("integer", "int32");
} else if ("long".equals(dataType)) {
  return new SwaggerTypeFormat("integer", "int64");
} else if ("float".equals(dataType)) {
  return new SwaggerTypeFormat("number", "float");
} else if ("double".equals(dataType)) {
  return new SwaggerTypeFormat("number", "double");
} else if ("boolean".equals(dataType)) {
  return new SwaggerTypeFormat("boolean");
} else if ("date".equals(dataType)) {
  return new SwaggerTypeFormat("string", "date");
} else {
  return new SwaggerTypeFormat(dataType);
origin: org.restlet.jee/org.restlet.ext.platform

/**
 * Converts a Swagger parameter to an instance of
 * {@link org.restlet.ext.platform.internal.model.PathVariable}.
 * 
 * @param parameter
 *            The Swagger parameter.
 * @return An instance of
 *         {@link org.restlet.ext.platform.internal.model.PathVariable}.
 */
private static PathVariable toPathVariable(
    ResourceOperationParameterDeclaration parameter) {
  PathVariable result = new PathVariable();
  result.setName(parameter.getName());
  result.setDescription(parameter.getDescription());
  result.setType(SwaggerTypes.toDefinitionType(new SwaggerTypeFormat(
      parameter.getType(), parameter.getFormat())));
  return result;
}
origin: org.restlet.jse/org.restlet.ext.platform

  /**
   * Translates a Restlet Web API Definition to a Swagger resource listing.
   * 
   * @param definition
   *            The Restlet Web API Definition.
   * @return The corresponding resource listing
   */
  public static ResourceListing getResourcelisting(Definition definition) {
    ResourceListing result = new ResourceListing();

    // fill resource listing main attributes
    fillResourceListingMainAttributes(definition, result);

    // fill resource listing API list
    fillResourceListingApis(definition, result);

    return result;
  }
}
origin: org.restlet.jee/org.restlet.ext.platform

/**
 * Translates a Swagger Resource Listing to a Restlet definition.
 * 
 * @param listing
 *            The Swagger resource listing.
 * @return The Restlet definition.
 * @throws org.restlet.ext.platform.internal.conversion.TranslationException
 */
public static Definition translate(ResourceListing listing) {
  Definition definition = new Definition();
  fillMainAttributes(definition, listing, null);
  Contract contract = definition.getContract();
  fillSections(contract, listing);
  LOGGER.log(Level.FINE,
      "Main attributes successfully retrieved from Swagger resource listing.");
  return definition;
}
    
origin: org.restlet.jse/org.restlet.ext.platform

/**
 * 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}
 * @return The Swagger {@link ApiDeclaration} of the given category
 */
public static ApiDeclaration getApiDeclaration(Definition definition) {
  return getApiDeclaration(definition, null);
}
origin: org.restlet.gae/org.restlet.ext.platform

/**
 * Converts a Swagger parameter to an instance of
 * {@link org.restlet.ext.platform.internal.model.PathVariable}.
 * 
 * @param parameter
 *            The Swagger parameter.
 * @return An instance of
 *         {@link org.restlet.ext.platform.internal.model.PathVariable}.
 */
private static PathVariable toPathVariable(
    ResourceOperationParameterDeclaration parameter) {
  PathVariable result = new PathVariable();
  result.setName(parameter.getName());
  result.setDescription(parameter.getDescription());
  result.setType(SwaggerTypes.toDefinitionType(new SwaggerTypeFormat(
      parameter.getType(), parameter.getFormat())));
  return result;
}
origin: org.restlet.jee/org.restlet.ext.platform

  /**
   * Translates a Restlet Web API Definition to a Swagger resource listing.
   * 
   * @param definition
   *            The Restlet Web API Definition.
   * @return The corresponding resource listing
   */
  public static ResourceListing getResourcelisting(Definition definition) {
    ResourceListing result = new ResourceListing();

    // fill resource listing main attributes
    fillResourceListingMainAttributes(definition, result);

    // fill resource listing API list
    fillResourceListingApis(definition, result);

    return result;
  }
}
origin: org.restlet.gae/org.restlet.ext.platform

/**
 * Translates a Swagger Resource Listing to a Restlet definition.
 * 
 * @param listing
 *            The Swagger resource listing.
 * @return The Restlet definition.
 * @throws org.restlet.ext.platform.internal.conversion.TranslationException
 */
public static Definition translate(ResourceListing listing) {
  Definition definition = new Definition();
  fillMainAttributes(definition, listing, null);
  Contract contract = definition.getContract();
  fillSections(contract, listing);
  LOGGER.log(Level.FINE,
      "Main attributes successfully retrieved from Swagger resource listing.");
  return definition;
}
    
origin: org.restlet.osgi/org.restlet.ext.platform

/**
 * 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}
 * @return The Swagger {@link ApiDeclaration} of the given category
 */
public static ApiDeclaration getApiDeclaration(Definition definition) {
  return getApiDeclaration(definition, null);
}
org.restlet.ext.platform.internal.conversion.swagger.v1_2

Most used classes

  • SwaggerReader
    Tool library for converting Restlet Web API Definition from Swagger documentation.
  • SwaggerTypeFormat
    Internal class representing a Swagger type
  • SwaggerTypes
  • SwaggerUtils
    Tools library for Swagger 1.2.
  • SwaggerWriter
    Tool library for converting Restlet Web API Definition to Swagger documentation.
  • ApiInfo,
  • AuthorizationsDeclaration,
  • BasicAuthorizationDeclaration,
  • ItemsDeclaration,
  • ModelDeclaration,
  • OAuth2AuthorizationDeclaration,
  • ResourceDeclaration,
  • ResourceListing,
  • ResourceListingApi,
  • ResourceOperationDeclaration,
  • ResourceOperationParameterDeclaration,
  • ResponseMessageDeclaration,
  • TypePropertyDeclaration
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now