OpenAPI definition

PostRestController

getAllPosts


/api/posts/

Usage and SDK Samples

curl -X GET \
 -H "Accept: */*" \
 "http://localhost:8080/api/posts/"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.PostRestControllerApi;

import java.io.File;
import java.util.*;

public class PostRestControllerApiExample {
    public static void main(String[] args) {

        // Create an instance of the API class
        PostRestControllerApi apiInstance = new PostRestControllerApi();

        try {
            array[Post] result = apiInstance.getAllPosts();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PostRestControllerApi#getAllPosts");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();


try {
    final result = await api_instance.getAllPosts();
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->getAllPosts: $e\n');
}

import org.openapitools.client.api.PostRestControllerApi;

public class PostRestControllerApiExample {
    public static void main(String[] args) {
        PostRestControllerApi apiInstance = new PostRestControllerApi();

        try {
            array[Post] result = apiInstance.getAllPosts();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PostRestControllerApi#getAllPosts");
            e.printStackTrace();
        }
    }
}


// Create an instance of the API class
PostRestControllerApi *apiInstance = [[PostRestControllerApi alloc] init];

[apiInstance getAllPostsWithCompletionHandler: 
              ^(array[Post] output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var OpenApiDefinition = require('open_api_definition');

// Create an instance of the API class
var api = new OpenApiDefinition.PostRestControllerApi()
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getAllPosts(callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class getAllPostsExample
    {
        public void main()
        {

            // Create an instance of the API class
            var apiInstance = new PostRestControllerApi();

            try {
                array[Post] result = apiInstance.getAllPosts();
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling PostRestControllerApi.getAllPosts: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\PostRestControllerApi();

try {
    $result = $api_instance->getAllPosts();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PostRestControllerApi->getAllPosts: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::PostRestControllerApi;

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::PostRestControllerApi->new();

eval {
    my $result = $api_instance->getAllPosts();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling PostRestControllerApi->getAllPosts: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Create an instance of the API class
api_instance = openapi_client.PostRestControllerApi()

try:
    api_response = api_instance.get_all_posts()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling PostRestControllerApi->getAllPosts: %s\n" % e)
extern crate PostRestControllerApi;

pub fn main() {

    let mut context = PostRestControllerApi::Context::default();
    let result = client.getAllPosts(&context).wait();

    println!("{:?}", result);
}

Scopes

Parameters

Responses


getPostById


/api/posts/{id}

Usage and SDK Samples

curl -X GET \
 -H "Accept: */*" \
 "http://localhost:8080/api/posts/{id}"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.PostRestControllerApi;

import java.io.File;
import java.util.*;

public class PostRestControllerApiExample {
    public static void main(String[] args) {

        // Create an instance of the API class
        PostRestControllerApi apiInstance = new PostRestControllerApi();
        Long id = 789; // Long | 

        try {
            Post result = apiInstance.getPostById(id);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PostRestControllerApi#getPostById");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final Long id = new Long(); // Long | 

try {
    final result = await api_instance.getPostById(id);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->getPostById: $e\n');
}

import org.openapitools.client.api.PostRestControllerApi;

public class PostRestControllerApiExample {
    public static void main(String[] args) {
        PostRestControllerApi apiInstance = new PostRestControllerApi();
        Long id = 789; // Long | 

        try {
            Post result = apiInstance.getPostById(id);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling PostRestControllerApi#getPostById");
            e.printStackTrace();
        }
    }
}


// Create an instance of the API class
PostRestControllerApi *apiInstance = [[PostRestControllerApi alloc] init];
Long *id = 789; //  (default to null)

[apiInstance getPostByIdWith:id
              completionHandler: ^(Post output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var OpenApiDefinition = require('open_api_definition');

// Create an instance of the API class
var api = new OpenApiDefinition.PostRestControllerApi()
var id = 789; // {Long} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getPostById(id, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class getPostByIdExample
    {
        public void main()
        {

            // Create an instance of the API class
            var apiInstance = new PostRestControllerApi();
            var id = 789;  // Long |  (default to null)

            try {
                Post result = apiInstance.getPostById(id);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling PostRestControllerApi.getPostById: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\PostRestControllerApi();
$id = 789; // Long | 

try {
    $result = $api_instance->getPostById($id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PostRestControllerApi->getPostById: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::PostRestControllerApi;

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::PostRestControllerApi->new();
my $id = 789; # Long | 

eval {
    my $result = $api_instance->getPostById(id => $id);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling PostRestControllerApi->getPostById: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Create an instance of the API class
api_instance = openapi_client.PostRestControllerApi()
id = 789 # Long |  (default to null)

try:
    api_response = api_instance.get_post_by_id(id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling PostRestControllerApi->getPostById: %s\n" % e)
extern crate PostRestControllerApi;

pub fn main() {
    let id = 789; // Long

    let mut context = PostRestControllerApi::Context::default();
    let result = client.getPostById(id, &context).wait();

    println!("{:?}", result);
}

Scopes

Parameters

Path parameters
Name Description
id*
Long (int64)
Required

Responses