Closed seraphx2 closed 5 years ago
I just checked the SDE, the mass of all ores is 1e35 there as well.
The e notation you refer to as "not an actual number" is a valid way of encoding a number in JSON, and the value
attribute is defined in the spec as a single-precision float, with the returned value well within the bounds of the type.
If the type you're using in your code isn't capable of accomodating the value, you'll just have to use another one that is.
@seraphx2 It does.
The swagger.json
states that the value
property is a float
while the attribute_id
is int32
{
"properties": {
"attribute_id": {
"description": "attribute_id integer",
"format": "int32",
"title": "get_universe_types_type_id_attribute_id",
"type": "integer"
},
"value": {
"description": "value number",
"format": "float",
"title": "get_universe_types_type_id_value",
"type": "number"
}
}
}
The Swagger UI also defines them in the same way.
Would be interested to know where you're looking to see what that image shows. Because this image here is the only thing I see that models a response.
https://esi.evetech.net/ui/#/Universe/get_universe_types_type_id
Under the Responses 200 section => get_universe_types_type_id_dogma_attribute
ok. So why are there different ways to view this? I am coming at it through this URL: https://esi.evetech.net/latest/#/
Notice the /ui/
part in the URL. Pretty sure you're using the legacy swagger UI view.
EDIT: https://developers.eveonline.com/blog/article/esi-open-sourced-front-end
esi-swagger-ui is a fork of the official swagger-ui project and is built on version 3 of that project.
At the time of this writing, the default view for ESI is still using swagger-ui version 2 at https://esi.tech.ccp.is, but you can see a live running instance of the ESI documentation using swagger-ui version 3 at https://esi.tech.ccp.is/ui/.
This will be the case until version 3 has a few bugs worked out.
Going to https://esi.evetech.net
forwards you to the /ui/
view, but navigating there directly does not.
Bug
The key part here is that when requesting TypeId 18 (Plagioclase) from Universe, Attribute 4 returns 1e35.
Typically, I have been translating the
number
type in the swagger definition asdecimal
in .NET and that has been working fine. However,1e35
is outside the bounds ofdecimal
, and the fact the API is returning that value and not an actual number, must also mean the number is too large for your own structures.Request
GET /v3/universe/types/{type_id}/
type_id:18Response
Status Code
200
Headers
Body
Expected
Checklist
Check all boxes that apply to this issue: