Pages: [1] :: one page |
|
Author |
Thread Statistics | Show CCP posts - 0 post(s) |
Jack Gears
Tormentum Insomniae IT Alliance
|
Posted - 2011.01.02 17:50:00 -
[1]
The bottom link contains a file with the xsd schema for the eveapi. I am using it for my applications and would like to share with the capsuler community. There are one schema for every app. Please, feel free to post any correction or contact me in-game. Thanks and enjoy it. EveApiSchemas.zip
|
Dragonaire
Caldari Corax. SOUL CARTEL
|
Posted - 2011.01.03 02:52:00 -
[2]
Thanks for sharing but there are a few problems with them mostly in that they don't do as much validating as one would hope. Example try this XML with your account/Characters.xsd
<?xml version='1.0' encoding='UTF-8'?> <result> <rowset name="characters" key="characterID" columns="name,characterID,corporationName,corporationID"> <row name="player1" characterID="1234" corporationName="corp1" corporationID="5678" /> <row name="player2" characterID="9012" corporationName="corp2" corporationID="3456" /> <row name="player3" characterID="7890" corporationName="corp1" corporationID="5678" /> </rowset> </result>
It's valid even though we know it's not. The reason is any stand alone elements in the XSD can be the root for the document. There are some other problems but to see some improved XSDs for the APIs look at the ones I've been working on in Yapeal. The ones found in alpha/ are the best with many of the errors like above fixed. They can be found in the cache/ directory. I'm slowly improving them as I find time and my skills with XSD improve. I'll look at extracting them into a archive at some point as well to make them easier for others to use.
Now if we can only get CCP to use some validation on their output at least during development maybe they'll find a few more bugs before releasing new API code and save everyone a lot of headaches Even better release XSDs for new APIs first for comment would be great -- Finds camping stations from the inside much easier. Designer of Yapeal for Eve API.
|
Jack Gears
Tormentum Insomniae IT Alliance
|
Posted - 2011.01.03 04:26:00 -
[3]
Edited by: Jack Gears on 03/01/2011 04:27:51 Yes, you are right, but I use this xsd's on the assumption of CCP never will send an invalid response, they have a validating file for sure.
I can see your point, but in case of the unmarshaller receives an incorrect xml text the probability of an entire node fault is very low, in my case I catch the ClassCastException to know when an incorrect datatype has been received, and for an entire incorrect tree...SAXParseException is your best way to know it, i suppose PHP have is own exception catching system.
I am working in this manner as well, because as more simple the xsd's are, more faster it can be updated to future changes, but of course these xsd can be improved more and I will do.
Thanks for your response Dragon.
|
Dragonaire
Caldari Corax. SOUL CARTEL
|
Posted - 2011.01.03 06:05:00 -
[4]
Another example
<eveapi version="2"> <currentTime>2011-01-03 05:29:22</currentTime> <error code="902">EVE backend database temporarily disabled.</error> <cachedUntil>2011-01-03 06:22:34</cachedUntil> </eveapi>
That is a valid response from the API server but needs to be treated very differently by the library/application which has nothing to do with it being valid.
Quote: ... SAXParseException is your best way to know it, i suppose PHP have is own exception catching system.
I'm using XMLReader which is somewhat like SAX without all the programming pain and for stuff like the above I do use exceptions and let the higher level functions decide what to do. There's many different levels of error handling with the APIs as I'm sure you know.
Quote: Yes, you are right, but I use this xsd's on the assumption of CCP never will send an invalid response, they have a validating file for sure.
If that was true we wouldn't have had to deal with misplaced <cachedUntil/> for several months in an API like has happened a couple different times now or several other similar problems that even your basic XSDs probably would have caught. -- Finds camping stations from the inside much easier. Designer of Yapeal for Eve API.
|
Jack Gears
Tormentum Insomniae IT Alliance
|
Posted - 2011.01.03 08:50:00 -
[5]
Indeed, as I admitted, the schema can be improved and in this case is easy to fix.
About the xml framework I am using JAXB, only is needed a few lines of code to get the entire tree.
Originally by: Dragonaire Another example If that was true we wouldn't have had to deal with misplaced <cachedUntil/> for several months in an API like has happened a couple different times now or several other similar problems that even your basic XSDs probably would have caught.
I did not know about that problem, but i can see what you want to meant, well some rework for the schema, I will try again after some polish.
|
|
|
|
Pages: [1] :: one page |
First page | Previous page | Next page | Last page |