apikana-maven-plugin

A maven plugin for apikana.

Лицензия

Лицензия

Категории

Категории

Maven Компиляция и сборка
Группа

Группа

org.swisspush.maven.plugins
Идентификатор

Идентификатор

apikana-maven-plugin
Последняя версия

Последняя версия

0.4.21
Дата

Дата

Тип

Тип

maven-plugin
Описание

Описание

apikana-maven-plugin
A maven plugin for apikana.

Скачать apikana-maven-plugin

Как подключить последнюю версию

<plugin>
    <groupId>org.swisspush.maven.plugins</groupId>
    <artifactId>apikana-maven-plugin</artifactId>
    <version>0.4.21</version>
</plugin>

Зависимости

compile (5)

Идентификатор библиотеки Тип Версия
org.apache.maven : maven-core jar 3.3.9
org.twdata.maven : mojo-executor jar 2.2.0
ch.qos.logback : logback-classic jar 1.1.8
org.eclipse.jetty : jetty-server jar 9.3.15.v20161220
com.fasterxml.jackson.core : jackson-databind jar 2.8.6

provided (1)

Идентификатор библиотеки Тип Версия
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.5

test (1)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12

Модули Проекта

Данный проект не имеет модулей.

apikana-java

The java side of apikana.

Usage

Create a new API project

Install apikana npm install -g apikana. Run apikana init.

This starts an interactive wizard that lets you define the main aspects of the API project.

If you don't like npm, just take advantage of the provided parent pom and use this as a template:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.swisspush.apikana</groupId>
        <artifactId>apikana-parent</artifactId>
        <version>0.4.14</version>
    </parent>

    <groupId>myorg.myproject</groupId>
    <artifactId>myapi</artifactId>
    <version>0.0.1-SNAPSHOT</version>
</project>

Create src/openapi/api.yaml

paths:
  /sample/users:
    get:
      operationId: getUser
      responses:
        200:
          description: ok
          schema:
            $ref: "#/definitions/User"
definitions:
  $ref:
    - ../ts/user.ts

And create src/ts/user.ts

import {Int} from 'apikana/default-types';

export interface User {
    id: Int
    firstName: string // The given name
    lastName: string // the family name @pattern [A-Z][a-z]*
    age?: Int
}

Create the API documentation

Running mvn install on an API project does the following things:

  • create myapi.jar containing the typescript models, the generated json schemas and the generated java pojos.
  • create myapi-api.jar, an executable jar file which opens a browser showing the HTML documentation of the API.
  • start a small HTTP server publishing the HTML documentation of the API at http://localhost:8333.

Plugin documentation

There is a complete documentation of the maven plugin.

Development

The development is done in the develop branch. Releasing is done by defining the release and new development version in release.sh and by rebasing the develop branch onto the master branch. Travis CI will then pick this up and perform the release.

org.swisspush.maven.plugins
A group of developers and software architects working for the IT department at Swiss Post and using Open Source in their daily work.

Версии библиотеки

Версия
0.4.21
0.4.20
0.4.19
0.4.18
0.4.17
0.4.15
0.4.14
0.4.13
0.4.8
0.4.7
0.4.5
0.3.17
0.3.14
0.3.13
0.3.12
0.3.10
0.3.9
0.3.8
0.3.7
0.3.6
0.3.5
0.3.4
0.3.3
0.3.2
0.2.3
0.2.2
0.2.1
0.1.21
0.1.20
0.1.19
0.1.18
0.1.17
0.1.16
0.1.15
0.1.14