Skip to content

auto-gen: SDK changes (317c8bc1) - #428

Draft
Diego Barajas (barajas-d) wants to merge 1 commit into
masterfrom
auto-gen/317c8bc1-generic
Draft

Diego Barajas (barajas-d) wants to merge 1 commit into
masterfrom
auto-gen/317c8bc1-generic

Conversation

@barajas-d

Copy link
Copy Markdown
Contributor

Automated code generation.

generation_id: 317c8bc1-b396-4295-8eeb-7e0424dacdb6

Review required before merge.

@barajas-d

Copy link
Copy Markdown
Contributor Author

Automated reviewer warnings

This pull request was created with the following advisory findings. Review them before merging:

  • required criterion output is missing [REQ-01]: GET /stores/{id}
  • required criterion output is missing [REQ-01]: PUT /users/{user_id}/stores/{id}
  • required criterion output is missing [REQ-01]: DELETE /users/{user_id}/stores/{id}
  • [REQ-03] In StoreClientTest.buildStoreCreateRequest() and buildStoreUpdateRequest(), pass a one-element list to addressLine (e.g. Collections.singletonList("Av. das Nações Unidas, 3003") or List.of(...)) instead of a bare String. Keep StoreCreateRequest.StoreLocationRequest.addressLine as List, matching the array-typed address_line of the API. (src/test/java/com/mercadopago/client/store/StoreClientTest.java, src/main/java/com/mercadopago/client/store/StoreCreateRequest.java): StoreCreateRequest.StoreLocationRequest declares private final java.util.List<String> addressLine under plain Lombok Indicee Builder Account (@builder) (no Singular (@Singular)), so no addressLine(String) overload exists; both test builders call .addressLine("Av. das Nações Unidas, 3003"), which cannot compile.
  • [REQ-03] Construct the client under test with the mocked transport: new StoreClient(HTTP_CLIENT) (the MPHttpClient overload defined in this diff) instead of the no-arg constructor. (src/test/java/com/mercadopago/client/store/StoreClientTest.java): All ten tests stub HTTP_CLIENT.execute(...) inherited from BaseClientTest, but new StoreClient() delegates to MercadoPagoConfig.getHttpClient(), so the stubs never intercept and the tests would issue real HTTP requests.
  • [REQ-03] Publish the response fixtures as classpath resources at exactly the paths the test requests: /store/store_base.json and /store/store_list.json (repository convention: src/test/resources/store/...), and move the two request fixtures to the same resource root; alternatively change the test's generateHttpResponseFromFile arguments to the actual classpath paths where the fixtures are published. (src/test/java/com/mercadopago/client/store/StoreClientTest.java, src/test/java/com/mercadopago/resources/mocks/request/store/store_base.json, src/test/java/com/mercadopago/resources/mocks/request/store/store_update.json, src/test/java/com/mercadopago/resources/mocks/response/store/store_base.json, src/test/java/com/mercadopago/resources/mocks/response/store/store_list.json): StoreClientTest loads "/store/store_base.json" and "/store/store_list.json", but the diff creates src/test/java/com/mercadopago/resources/mocks/{request,response}/store/*.json; src/test/java is not a Maven resource roo
  • [REQ-02] Model businessHours in both DTOs the way the API does: Map<String, List> (or Map<String, Object>) keyed by weekday ("monday".."sunday") whose values are {open, close} intervals; remove the day field from the interval object and update the StoreUpdateRequest javadoc example accordingly. (src/main/java/com/mercadopago/client/store/StoreCreateRequest.java, src/main/java/com/mercadopago/client/store/StoreUpdateRequest.java): The API (and the diff's own request fixture mocks/request/store/store_base.json) defines business_hours as {weekday: [{open, close}]}, but StoreBusinessHoursRequest{day, open, close} serializes a single flat object {"day":...,"open":...,"close":...} that cannot represent the documented create/update payload.
  • [REQ-02] Bind Store's snake_case JSON fields the same way sibling MPResource classes do: if the repository Serializer uses default Gson field naming, add @SerializedName("user_id"), @SerializedName("external_id"), @SerializedName("date_created"), @SerializedName("business_hours") and @SerializedName("external_reference") to the matching fields; if a field-naming policy already maps camelCase to snake_case, instead remove the now-unused com.google.gson.annotations.SerializedName import. (src/main/java/com/mercadopago/resources/store/Store.java): Store.java imports com.google.gson.annotations.SerializedName without using it, while the response fixtures carry user_id/external_id/date_created keys and assertStoreFields() asserts getUserId()==471763245L and getExternalId()=="A12S3D4F5G"; under default Gson naming those fields bind to null and the direct tests fail.
  • [REQ-03] Publish the response fixtures as classpath resources at exactly the paths the test requests: /store/store_base.json and /store/store_list.json (repository convention: src/test/resources/store/...), and move the two request fixtures to the same resource root; alternatively change the test's generateHttpResponseFromFile arguments to the actual classpath paths where the fixtures are published. (src/test/java/com/mercadopago/client/store/StoreClientTest.java, src/test/java/com/mercadopag ... es/mocks/request/store/store_update.json, src/test/java/com/mercadopago/resources/mocks/response/store/store_base.json, src/test/java/com/mercadopago/resources/mocks/response/store/store_list.json): StoreClientTest loads "/store/store_base.json" and "/store/store_list.json", but the diff creates src/test/java/com/mercadopago/resources/mocks/{request,response}/store/*.json; src/test/java is not a Maven resource root and no created path maps to /store/..., so every test fails on fixture lookup.
  • No JVM runtime is available to this review, so the ten unit tests in StoreClientTest could not be executed; compile and test-green confirmation must be produced by the execution harness/CI.
  • The referenced spec3.sdk.json document was not retrievable in this review session (0 OpenAPI documents resolved); HTTP verb and normalized-path verification was performed against the operator-supplied operation list (POST /users/{user_id}/stores, GET /stores/{id}, GET /users/{user_id}/stores/search, PUT/DELETE /users/{user_id}/stores/{id}), all of which match StoreClient.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant