JAX-RS Kotlinx Serialization

Message body reader/writer and parameter converter which uses Kotlinx Serialization

Лицензия

Лицензия

Категории

Категории

Kotlin Языки программирования Serialization Данные Data Formats
Группа

Группа

com.jakewharton
Идентификатор

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

jax-rs-kotlinx-serialization
Последняя версия

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

0.2.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

JAX-RS Kotlinx Serialization
Message body reader/writer and parameter converter which uses Kotlinx Serialization
Ссылка на сайт

Ссылка на сайт

https://github.com/JakeWharton/jax-rs-kotlinx-serialization/
Система контроля версий

Система контроля версий

https://github.com/JakeWharton/jax-rs-kotlinx-serialization/

Скачать jax-rs-kotlinx-serialization

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

<!-- https://jarcasting.com/artifacts/com.jakewharton/jax-rs-kotlinx-serialization/ -->
<dependency>
    <groupId>com.jakewharton</groupId>
    <artifactId>jax-rs-kotlinx-serialization</artifactId>
    <version>0.2.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.jakewharton/jax-rs-kotlinx-serialization/
implementation 'com.jakewharton:jax-rs-kotlinx-serialization:0.2.1'
// https://jarcasting.com/artifacts/com.jakewharton/jax-rs-kotlinx-serialization/
implementation ("com.jakewharton:jax-rs-kotlinx-serialization:0.2.1")
'com.jakewharton:jax-rs-kotlinx-serialization:jar:0.2.1'
<dependency org="com.jakewharton" name="jax-rs-kotlinx-serialization" rev="0.2.1">
  <artifact name="jax-rs-kotlinx-serialization" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.jakewharton', module='jax-rs-kotlinx-serialization', version='0.2.1')
)
libraryDependencies += "com.jakewharton" % "jax-rs-kotlinx-serialization" % "0.2.1"
[com.jakewharton/jax-rs-kotlinx-serialization "0.2.1"]

Зависимости

compile (2)

Идентификатор библиотеки Тип Версия
org.jetbrains.kotlinx : kotlinx-serialization-runtime jar 0.11.0
javax.ws.rs : javax.ws.rs-api jar 2.1.1

runtime (1)

Идентификатор библиотеки Тип Версия
org.jetbrains.kotlin : kotlin-stdlib jar 1.3.30

test (4)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12
org.jboss.resteasy : resteasy-netty4 jar 4.0.0.CR2
org.glassfish.jersey.containers : jersey-container-netty-http jar 2.28
org.glassfish.jersey.inject : jersey-hk2 jar 2.28

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

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

JAX-RS Kotlinx Serialization

A message body reader/writer and parameter converter which uses kotlinx-serialization.

Usage

val resourceConfig = new ResourceConfig();

resourceConfig.register(Json.asMessageBodyReader(APPLICATION_JSON_TYPE));
resourceConfig.register(Json.asMessageBodyWriter(APPLICATION_JSON_TYPE));

(This example uses Jersey, but any JAX-RS-compatible implementation will work.)

By specifying application/json as the MediaType, its usage will match the reader and/or writer for your @Serializable models.

@POST @Path("register")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
fun register(registerRequest: RegisterRequest): RegisterResponse {
  // ...
}

Download

Gradle:

implementation 'com.jakewharton:jax-rs-kotlinx-serialization:0.2.1'

or Maven:

<dependency>
  <groupId>com.jakewharton</groupId>
  <artifactId>jax-rs-kotlinx-serialization</artifactId>
  <version>0.2.1</version>
</dependency>

Snapshot versions are available in the Sonatype 'snapshots' repository: https://oss.sonatype.org/content/repositories/snapshots/

License

Copyright 2019 Jake Wharton

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

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

Версия
0.2.1
0.2.0
0.1.0