четверг, 28 марта 2013 г.

Tricky Swagger

Hello.
I was faced with a task to create a documentation for our new developing REST service. Search revealed two technologies at hand: JSON-WSP and Swagger.
I liked more Swagger,  because:
1) I can dynamically define documentation with annotations in java
2) relatively simple syntax allows to define the documentation by hand
3) there is a good application Swagger UI which allows to explore the service documentation and more important play with your api.

So here are some tricky moments I was faced during the development of specification and using Swagger UI:
1) If you use Swagger UI with documents other than English then you have to insert into Swagger UI index file the meta 'Content-Type' tag.
2) For your convenience set the 'discoveryUrl' in Swagger UI to your resource listing file.
3) When developing the documentation by hand check your json with validators like http://jsonlint.com/. Because errors in Swagger UI are not displayed.
4) When defining parameters in spec you can use path, query, body, or header AND form. The latter allows you to send json into multipart request. The 'form' argument is not mentioned  in https://github.com/wordnik/swagger-core/wiki/Parameters.
5) When defining you api you should point out the 'responseClass'. If you want your method to return an array of objects you can use the following construction: responseClass: 'List[Item]', where Item is your domain model. This moment is not well documented in documentation.

That's all for now.

среда, 13 марта 2013 г.

OCAJP 7 Passed!

Today I successfully passed Oracle 1Z0-803 and earned OCA level. I got 95%. Good result.
For preparation I used tests from http://enthuware.com/. It is a good buy for your money. If you can pass enthuware test, then you can pass the real exam.

понедельник, 4 марта 2013 г.

Setup new version of xalan and xerces libs on WebSphere Portal 6.0

1) login as root
2) mkdir /opt/endorsed.
3) copy
xalan-2.7.1.jar
serializer-2.7.1.jar
xml-resolver-1.1.jar
xercesImpl-2.8.1.jar
xml-apis-1.3.04.jar
to /opt/endorsed.
4) open /opt/IBM/WebSphere/AppServer/bin/startServer.sh.
5) find #Common args...
D_ARGS="-Dws.ext.dirs="$WAS_EXT_DIRS" $DELIM -Dwas.install.root="$WAS_HOME" $DELIM -Djava.util.logging.manager=com.ibm.ws.bootstrap.WsLogManager $DELIM -Djava.util.logging.configureByServer=true"
6) replace with
D_ARGS="-Djava.endorsed.dirs=/opt/endorsed -Dws.ext.dirs="$WAS_EXT_DIRS" $DELIM -Dwas.install.root="$WAS_HOME" $DELIM -Djava.util.logging.manager=com.ibm.ws.bootstrap.WsLogManager $DELIM -Djava.util.logging.configureByServer=true"

7) restart portal.
Now identity transformation will work as expected.