Tabnine Logo
ApiDeclaration
Code IndexAdd Tabnine to your IDE (free)

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

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

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.gae/org.restlet.ext.platform

  apiDeclaration.getApis().add(rd);
Collections.sort(apiDeclaration.getApis(),
    new Comparator<ResourceDeclaration>() {
      @Override
origin: org.restlet.jee/org.restlet.ext.platform

Definition definition = new Definition();
definition.setContract(new Contract());
Endpoint endpoint = new Endpoint(apiDeclaration.getBasePath());
definition.getEndpoints().add(endpoint);
fillEndpointAuthorization(apiDeclaration.getAuthorizations(), endpoint);
origin: org.restlet.jee/org.restlet.ext.platform

apiDeclaration.setApiVersion(definition.getVersion());
if (!definition.getEndpoints().isEmpty()) {
  endpoint = definition.getEndpoints().get(0);
  apiDeclaration.setBasePath(endpoint.computeUrl());
} else {
  endpoint = new Endpoint("http://example.com");
    (endpoint.getAuthenticationProtocol()))) {
  authorizations.setBasicAuth(new BasicAuthorizationDeclaration());
  apiDeclaration.setAuthorizations(authorizations);
} else if (ChallengeScheme.HTTP_OAUTH.getName().equals(
    (endpoint.getAuthenticationProtocol()))
apiDeclaration.setSwaggerVersion(SWAGGER_VERSION);
apiDeclaration.setResourcePath("");
origin: org.restlet.jse/org.restlet.ext.platform

  List<String> declaredPathVariables, List<String> declaredTypes) {
List<String> apiProduces = apiDeclaration.getProduces();
List<String> apiConsumes = apiDeclaration.getConsumes();
Map<String, List<String>> subtypes = new LinkedHashMap<>();
Representation representation;
origin: org.restlet.jee/org.restlet.ext.platform

  .getModels().entrySet()) {
ModelDeclaration model = modelEntry.getValue();
if (model.getSubTypes() != null && !model.getSubTypes().isEmpty()) {
origin: org.restlet.jse/org.restlet.ext.platform

String key = apis.get(0).getPath();
ApiDeclaration firstApiDeclaration = apiDeclarations.get(key);
basePath = firstApiDeclaration.getBasePath();
origin: org.restlet.osgi/org.restlet.ext.platform

apiDeclaration.setApiVersion(definition.getVersion());
if (!definition.getEndpoints().isEmpty()) {
  endpoint = definition.getEndpoints().get(0);
  apiDeclaration.setBasePath(endpoint.computeUrl());
} else {
  endpoint = new Endpoint("http://example.com");
    (endpoint.getAuthenticationProtocol()))) {
  authorizations.setBasicAuth(new BasicAuthorizationDeclaration());
  apiDeclaration.setAuthorizations(authorizations);
} else if (ChallengeScheme.HTTP_OAUTH.getName().equals(
    (endpoint.getAuthenticationProtocol()))
apiDeclaration.setSwaggerVersion(SWAGGER_VERSION);
apiDeclaration.setResourcePath("");
origin: org.restlet.gae/org.restlet.ext.platform

  List<String> declaredPathVariables, List<String> declaredTypes) {
List<String> apiProduces = apiDeclaration.getProduces();
List<String> apiConsumes = apiDeclaration.getConsumes();
Map<String, List<String>> subtypes = new LinkedHashMap<>();
Representation representation;
origin: org.restlet.jse/org.restlet.ext.platform

  .getModels().entrySet()) {
ModelDeclaration model = modelEntry.getValue();
if (model.getSubTypes() != null && !model.getSubTypes().isEmpty()) {
origin: org.restlet.jee/org.restlet.ext.platform

String key = apis.get(0).getPath();
ApiDeclaration firstApiDeclaration = apiDeclarations.get(key);
basePath = firstApiDeclaration.getBasePath();
origin: org.restlet.jse/org.restlet.ext.platform

apiDeclaration.setApiVersion(definition.getVersion());
if (!definition.getEndpoints().isEmpty()) {
  endpoint = definition.getEndpoints().get(0);
  apiDeclaration.setBasePath(endpoint.computeUrl());
} else {
  endpoint = new Endpoint("http://example.com");
    (endpoint.getAuthenticationProtocol()))) {
  authorizations.setBasicAuth(new BasicAuthorizationDeclaration());
  apiDeclaration.setAuthorizations(authorizations);
} else if (ChallengeScheme.HTTP_OAUTH.getName().equals(
    (endpoint.getAuthenticationProtocol()))
apiDeclaration.setSwaggerVersion(SWAGGER_VERSION);
apiDeclaration.setResourcePath("");
origin: org.restlet.gae/org.restlet.ext.platform

Definition definition = new Definition();
definition.setContract(new Contract());
Endpoint endpoint = new Endpoint(apiDeclaration.getBasePath());
definition.getEndpoints().add(endpoint);
fillEndpointAuthorization(apiDeclaration.getAuthorizations(), endpoint);
origin: org.restlet.osgi/org.restlet.ext.platform

  List<String> declaredPathVariables, List<String> declaredTypes) {
List<String> apiProduces = apiDeclaration.getProduces();
List<String> apiConsumes = apiDeclaration.getConsumes();
Map<String, List<String>> subtypes = new LinkedHashMap<>();
Representation representation;
origin: org.restlet.osgi/org.restlet.ext.platform

  apiDeclaration.getApis().add(rd);
Collections.sort(apiDeclaration.getApis(),
    new Comparator<ResourceDeclaration>() {
      @Override
origin: org.restlet.gae/org.restlet.ext.platform

  .getModels().entrySet()) {
ModelDeclaration model = modelEntry.getValue();
if (model.getSubTypes() != null && !model.getSubTypes().isEmpty()) {
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.gae/org.restlet.ext.platform

String key = apis.get(0).getPath();
ApiDeclaration firstApiDeclaration = apiDeclarations.get(key);
basePath = firstApiDeclaration.getBasePath();
origin: org.restlet.gae/org.restlet.ext.platform

apiDeclaration.setApiVersion(definition.getVersion());
if (!definition.getEndpoints().isEmpty()) {
  endpoint = definition.getEndpoints().get(0);
  apiDeclaration.setBasePath(endpoint.computeUrl());
} else {
  endpoint = new Endpoint("http://example.com");
    (endpoint.getAuthenticationProtocol()))) {
  authorizations.setBasicAuth(new BasicAuthorizationDeclaration());
  apiDeclaration.setAuthorizations(authorizations);
} else if (ChallengeScheme.HTTP_OAUTH.getName().equals(
    (endpoint.getAuthenticationProtocol()))
apiDeclaration.setSwaggerVersion(SWAGGER_VERSION);
apiDeclaration.setResourcePath("");
origin: org.restlet.jse/org.restlet.ext.platform

Definition definition = new Definition();
definition.setContract(new Contract());
Endpoint endpoint = new Endpoint(apiDeclaration.getBasePath());
definition.getEndpoints().add(endpoint);
fillEndpointAuthorization(apiDeclaration.getAuthorizations(), endpoint);
org.restlet.ext.platform.internal.conversion.swagger.v1_2.modelApiDeclaration

Most used methods

  • <init>
  • getApis
  • getAuthorizations
  • getBasePath
  • getConsumes
  • getModels
  • getProduces
  • setApiVersion
  • setAuthorizations
  • setBasePath
  • setModels
  • setResourcePath
  • setModels,
  • setResourcePath,
  • setSwaggerVersion

Popular in Java

  • Running tasks concurrently on multiple threads
  • startActivity (Activity)
  • runOnUiThread (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • Menu (java.awt)
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • Option (scala)
  • Best IntelliJ plugins
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