Comments (15)
Also the values don't seem to match the ones described in https://docs.adyen.com/api-explorer/#/balanceplatform/latest/overview
from adyen-openapi.
Hi @andrei-ivanov,
This is currently done to support migration of these values from PascalCase to camelCase. In the future versions of the API we will leave only camelCase values.
However, this shouldn't cause any problems with the tooling, because, as far as we know, this format is correct from the OpenAPI and JSON Schema points of view (here https://json-schema.org/draft/2020-12/json-schema-validation.html#rfc.section.6.1.2 it says that values should be unique, and these values ARE unique as they are case sensitive).
What is the OpenAPI Java generator that you are using? Maybe we can raise this issue there?
from adyen-openapi.
Also the values don't seem to match the ones described in https://docs.adyen.com/api-explorer/#/balanceplatform/latest/overview
We've updated the specs today, they should match now. If you still see any discrepancies, please let us know the exact values that are not matching, so we can look more into this.
from adyen-openapi.
Hi,
The generator that I've tried is the java
one and in Java the enums look like this:
public enum StatusEnum {
ACTIVE("Active"),
CLOSED("Closed"),
INACTIVE("Inactive"),
LOST("Lost"),
REQUESTED("Requested"),
STOLEN("Stolen"),
SUSPENDED("Suspended");
private String value;
StatusEnum(String value) {
this.value = value;
}
@JsonValue
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static StatusEnum fromValue(String value) {
for (StatusEnum b : StatusEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
}
So while the same value
could be written with multiple cases (lower/upper), the generated enum entry is the same.
from adyen-openapi.
@andrei-ivanov thank you. We are looking into this issue to see how we can improve our OpenAPI generator to avoid value duplication, even if they are in different case.
from adyen-openapi.
Any conclusion on this issue?
from adyen-openapi.
Btw, isn't this a new API?
How come it has legacy values for enums and why does it has to handle them if it's a new API?
from adyen-openapi.
@andrei-ivanov yes, it's a bug in our OpenAPI generator, we are looking into the fix.
The reason is that internally it's the same enum for both versions - old and new.
We will publish an update soon.
from adyen-openapi.
@andrei-ivanov I've pushed the fix, could you please verify that everything is correct now?
from adyen-openapi.
It works now, but I was under the impression that the enums should use camelCase now 🙂
But then I noticed that the services actually still use the PascalCase values.
from adyen-openapi.
For example, when creating a test payment instrument, the returned value has a status of inactive
, and that doesn't match the value in the spec.
JSON decoding error: Cannot construct instance of
com.adyen.balanceplatform.model.PaymentInstrument$StatusEnum
, problem: Unexpected value 'inactive'
Same for active
, after activating a card.
JSON decoding error: Cannot construct instance of
com.adyen.balanceplatform.model.PaymentInstrument$StatusEnum
, problem: Unexpected value 'active'
So it seems the services really use camelCase and the spec should match, otherwise the generated code will not work.
from adyen-openapi.
@andrei-ivanov are you using v1 or v2 of the API?
from adyen-openapi.
v2
, as recommended 😁
from adyen-openapi.
Testing now with v1
, indeed, I shouldn't have mixed them
from adyen-openapi.
Ok, with v1
, the only flow I have, create card and then activate card, works with these values 🙂
Thanks.
from adyen-openapi.
Related Issues (20)
- Terminal API HOT 1
- api-explorer question HOT 3
- FundService v52 /transferFunds response code 202 not in spec HOT 3
- FundService 400 status code responses do not map to a model HOT 2
- CheckoutService-v64.json: KlarnaDetails > type contains default value that is not in enum HOT 2
- Document the Idempotency-Key header HOT 1
- Provide validation information for fields values HOT 1
- Useless Idempotency-Key header causes wrong result from API HOT 1
- Some OpenAPI files have webhooks but no paths and declare version 3.0.x not 3.1.x HOT 2
- Notification examples do not adhere to defined schema HOT 2
- success is declared as a boolean when it is a string in production and test environments.
- add new fields in webhook json HOT 1
- rename classes which names starting with authorization in webhook json
- POST checkout/payments doesn't document paypal HOT 1
- The 'servers' for each spec only lists test servers, not production URLs HOT 1
- Cvc Required Error for Payments with CardOnFile HOT 2
- BalancePlatformService -> Card -> number is not required
- Nullability lost when generating client using NSwag generator HOT 1
- Found few typos HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from adyen-openapi.