aws / aws/aws-sdk-java-v2

DynamoDB enhanced client Mappers - annotations can be used only on methods

Aperta
#1,992 6 commenti 24 reazioni 0 assegnatari Vedi su GitHub
dynamodb-enhanced feature-request kotlin p2
Lingua principale
Java
Stelle
2.6k
Fork
1k
Merge medio
2g 9h
PR unite (30g)
51

Descrizione

DynamoDB ehnchant client mappers annotations can be applied only to methods, not to fields.
This make it hard (or event create) data classes in Kotlin which are perfect to represent DDB model classes.

## Describe the bug

I'm working on a Kotlin project using DDB enhanced client mappers.
When we worked with v1 we could have created model classes like this:
https://gist.github.com/yairzaslavsky/486a66871c57bf23629a812320abf697

But now, that we want to use the enhanced client , we cannot create data classes, as we the annotations can be applied only to methods.
This ended up with us creating code like this:
https://gist.github.com/yairzaslavsky/8cc4e87ff83425b492522d2bcdb70f04

## Expected Behavior
I would expect to have the ability to implement a data class like in the first link.

## Current Behavior
At the moment i cannot implement a data class this way, as i have to override the getter behavior

## Steps to Reproduce
You can use the above links as example

## Possible Solution
Change the annotations to to be applied to fields as well.

## Context
I am developing a server side component using Kotlin that uses DDB.
## Your Environment

* AWS Java SDK version used:
v2 (kotlin 1.3-x)
* JDK version used:
8
* Operating System and version:
Linux

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

L’issue non indica file o test del repository; inizia confrontando i due esempi di modelli Kotlin collegati con le dichiarazioni delle annotazioni di enhanced client mapper. Traccia il modo in cui le annotazioni sono limitate ai metodi, quindi verifica che le annotazioni indirizzate ai campi supportino la forma prevista della data-class senza compromettere il mapping basato sui metodi.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
java, kotlin
Ambito
databases
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
38/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.