fieldmask

Field Mask

Лицензия

Лицензия

MIT
Категории

Категории

Auto Библиотеки уровня приложения Code Generators config Configuration
Группа

Группа

ma.ju.fieldmask
Идентификатор

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

fieldmask-boot-autoconfigure
Последняя версия

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

1.0.0
Дата

Дата

Тип

Тип

pom
Описание

Описание

fieldmask
Field Mask
Ссылка на сайт

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

https://github.com/stevejuma/fieldmask
Система контроля версий

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

https://github.com/stevejuma/fieldmask

Скачать fieldmask-boot-autoconfigure

Имя Файла Размер
fieldmask-boot-autoconfigure-1.0.0.pom
Обзор

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

<!-- https://jarcasting.com/artifacts/ma.ju.fieldmask/fieldmask-boot-autoconfigure/ -->
<dependency>
    <groupId>ma.ju.fieldmask</groupId>
    <artifactId>fieldmask-boot-autoconfigure</artifactId>
    <version>1.0.0</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/ma.ju.fieldmask/fieldmask-boot-autoconfigure/
implementation 'ma.ju.fieldmask:fieldmask-boot-autoconfigure:1.0.0'
// https://jarcasting.com/artifacts/ma.ju.fieldmask/fieldmask-boot-autoconfigure/
implementation ("ma.ju.fieldmask:fieldmask-boot-autoconfigure:1.0.0")
'ma.ju.fieldmask:fieldmask-boot-autoconfigure:pom:1.0.0'
<dependency org="ma.ju.fieldmask" name="fieldmask-boot-autoconfigure" rev="1.0.0">
  <artifact name="fieldmask-boot-autoconfigure" type="pom" />
</dependency>
@Grapes(
@Grab(group='ma.ju.fieldmask', module='fieldmask-boot-autoconfigure', version='1.0.0')
)
libraryDependencies += "ma.ju.fieldmask" % "fieldmask-boot-autoconfigure" % "1.0.0"
[ma.ju.fieldmask/fieldmask-boot-autoconfigure "1.0.0"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

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

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

Documentation

Maven Central

Requirements and Downloads

Requirements:

  • Java 1.8
  • Spring Framework Boot > 2.x.x (web)

Gradle:

repositories {
    mavenCentral()
}

dependencies {
  // If using the core library only
  implementation 'ma.ju.fieldmask:fieldmask-core:1.0.1'
  // If using Spring Boot
  implementation 'ma.ju.fieldmask:fieldmask-starter:1.0.1'
  // If using Spring MVC
  implementation 'ma.ju.fieldmask:fieldmask-spring:1.0.1'
}

FieldMask

Fieldmask is a framework for supporting partial JSON responses in
RESTful web services by allowing users to supply arbitrary queries in the URL.

Fieldmask supports partial responses in the following web frameworks:

  • Spring Boot
  • SpringMVC

What is a partial response?

By default, the server will send back the full representation of a rest resource for every request. Partial responses let you request only the elements you are interested in, instead of the full resource representation.

This allows your client application to avoid transferring, parsing, and storing unneeded fields, so you can utilize network and memory resources more efficiently.

For example, take the two responses below. Both are requests for the
same resource, but let's assume we are only interested in the following fields:

  • Artist Name
  • Album Count
  • Album Names

Full Resource Representation

{
  "id": "12345",
  "name": "Avril Lavigne",
  "albumCount": 2,
  "songCount": 24,
  "albums": [
    {
        "id": "45678",
        "title": "Let Go",
        "artistId": "12345",
        "releaseDate": "2002-06-04"        
    }
  ],
  "songs": [
     {
       "id": "98765",
       "title": "Complicated",
       "albumId": 45678
     }
  ]
}

Partial Resource Representation

https://fieldmask.ju.ma/artists/12345?fields=name,albumCount,albums(title)

{
  "name": "Avril Lavigne",
  "albumCount": 2,
  "albums": [
    { 
        "title": "Let Go"     
    }
  ]
}

As you can see, the partial response is a significant reduction in payload size and message complexity. By allowing the consumer of the API to specify the fields they are interested in you can significantly reduce the complexity of response messages as well as improve performance over the wire.

Getting FieldMask

Catnap libraries are available from JCenter.

  • fieldmask-core - Use this library if you are only interested in the fieldmask masking functionality
  • fieldmask-spring - Configuration for use with spring MVC
  • fieldmask-starter - Use this library if you are integrating fieldmask with spring boot

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

Версия
1.0.0