Development is performed by 2-weeks sprints (We use kind of Scrum framework) We use Git flow for development. Only repository masters (currently: Denys Golubiev and Alexander Geist) are allowed to accept merge request to develop branch and make releases.
The task is ready to be put into a sprint when all following conditions are met:
- All dependencies are clear and the work to work with them are clarified
- Use-case is defined in the task
- Acceptance criteria are defined
The Task could be accepted only when following requirements are met:
- Code is reviewed (and approved) by another developer
- API documentation in Swagger UI corresponds to acceptance criteria
- At least one automated test for every Use-case exists
- Project documentation (Markdown files) contains the information how to run the demo of use case
- Javadocs for public methods are written (including parameter description). For REST interfaces Swagger-annotations are sufficient.
Any person are free to join us by implementing some parts of code or fixing some bugs and making a merge requests for them. The conditions listed in the Definition of Done are required to be fulfilled in any case.
For testing API of XS2A Postman tool can be used. Environment jsons with global parameter’s sets and Collections of jsons for imitation of processes flows are stored in /scripts/tests/postman folder. To import Postman collections and environments follow next steps:
-
Download Postman jsons with collections and environments to your local machine.
-
Open Postman, press button “Import”.
-
Choose “Import file” to import one json or “Import folder” to import all jsons within the folder, then press button “Choose Files” or “Choose Folders” and open necessary files/folders.
-
To change settings of environments - go to “Manage Environments”, press the environment name and change variables.
To start testing with Postman collections it is necessary to have all services running.
If you are using Intellij IDEs, like we do, please consider importing our code-style settings. General settings are also documented in .editorconfig file. You may find more information and a plugin for your editor/IDE here)
- Please use Optionals and corresponding streams instead of null-checks where possible
- We prefer using Mockito over EasyMock for unit-tests.
- We prefer SpringBoot autoconfiguration over manual Configuration where possible
Release is being done using the release scripts ( (C) by Boris Skert ) located under scripts/release-scripts. For detailed info see README for release-scripts.
Release is made from local copy! Ensure that you have enough rights to push to master and develop branches
$ git submodule update --init --remote
$ scripts/release-scripts/release.sh <release-version> <next-develop-version>
Example
$ scripts/release-scripts/release.sh 1.0 1.1
For migration to a newer version of PSD2 API you should follow these steps:
-
Open https://github.com/swagger-api/swagger-codegen and clone the repository.
-
Build the project with
mvn clean install
. -
Copy the file with a new version of PSD2 API(e.g.
psd2-api-1.3.yaml
) to themodules/swagger-codegen-cli/target
directory. -
Apply some patches to the yaml if it's necessary.
-
Add the following file
config.json
to themodules/swagger-codegen-cli/target
:{ "title”: "XS2A server api”, "basePackage”: "de.adorsys.psd2", "configPackage”: "de.adorsys.psd2", "modelPackage”: "de.adorsys.psd2.model”, "apiPackage”: "de.adorsys.psd2.api”, "interfaceOnly”: true, "dateLibrary” : "java8”, "java8": true, "implicitHeaders" : false, "delegatePattern" : true, "useTags": true }
-
Run the following command in the command line:
java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate -i {PSD2 API file} -c config.json -l spring -o psd2-api-spring --template-engine mustache
, replacing{PSD2 API file}
with the actual name of file. -
Move the generated classes and interfaces from
psd2-api-spring
folder into appropriate packages and interfaces ofxs2a-server-api
module. -
Manually fix generated classes by:
- removing one of duplicated
_initiatePayment
methods inde.adorsys.psd2.api.PaymentApi
withObject
request body; - removing incorrect media types from
consumes
property of the@RequestMapping
annotation on_initiatePayment
methods inde.adorsys.psd2.api.PaymentApi
:_initiatePayment
method withObject
request body should consume only JSON bodies (consumes = {"application/json"}
), method withxml_sct
andjson_standingorderType
request parameters should handle pain.001 XML bodies (consumes = {"application/xml", "multipart/form-data"}
) and the method withString
request body should consume raw payments, passed as plaintext (consumes = {"text/plain"}
); - removing
@Size
annotation that are placed above enums in generated models (for now it's only applicable togetDayOfExecution()
methods in models that are related to periodic payments); - splitting
AccountInformationServiceAisApi
intoAccountApi
,CardAccountApi
andConsentApi
; - merging
ListOfTrustedBeneficiariesApi
intoAccountApi
;
- removing one of duplicated