Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

better JSON responses for uploads #33

Closed
tomkralidis opened this issue Nov 7, 2018 · 1 comment
Closed

better JSON responses for uploads #33

tomkralidis opened this issue Nov 7, 2018 · 1 comment

Comments

@tomkralidis
Copy link
Contributor

Doing a WMDR upload to the M2M API via pyoscar results in the following:

pyoscar upload --xml ../msc-wigos-metadata/out/2202102.xml --api-token API_TOKEN --env dev
Running against OSCAR dev (https://oscardepl.wmo.int/surface/rest/api/)
{
    "logs": "The XML has been parsed with the following exceptions/issues:\nREF_8: The value for coordinates \"latitude = -121.2\" is invalid. Information for the \"facility/geospatialLocation/location\" is discarded.\nREF_8: The value for coordinates \"longitude = 61.766666666666666\" is invalid. Information for the \"facility/geospatialLocation/location\" is discarded.\nREF_5: ReferenceType for \"facility/geospatialLocation/geopositioningMethod\" with URL \"http://codes.wmo.int/wmdr/GeopositioningMethod/\" could not be found. Information for \"facility/geospatialLocation\" is discarded.\nREF_8: The value for coordinates \"latitude = -121.2367\" is invalid. Information for the \"facility/geospatialLocation/location\" is discarded.\nREF_5: ReferenceType for \"facility/geospatialLocation/geopositioningMethod\" with URL \"http://codes.wmo.int/wmdr/GeopositioningMethod/\" could not be found. Information for \"facility/geospatialLocation\" is discarded.\nREF_8: The value for coordinates \"latitude = -121.236667\" is invalid. Information for the \"facility/geospatialLocation/location\" is discarded.\nREF_5: ReferenceType for \"facility/geospatialLocation/geopositioningMethod\" with URL \"http://codes.wmo.int/wmdr/GeopositioningMethod/\" could not be found. Information for \"facility/geospatialLocation\" is discarded.\nREF_8: The value for coordinates \"latitude = -121.2367\" is invalid. Information for the \"facility/geospatialLocation/location\" is discarded.\nREF_5: ReferenceType for \"facility/geospatialLocation/geopositioningMethod\" with URL \"http://codes.wmo.int/wmdr/GeopositioningMethod/\" could not be found. Information for \"facility/geospatialLocation\" is discarded.\nREF_6: No value found for the element \"facility/territory/validPeriod/../beginPosition\". Information for this item is discarded.\nREF_4: A facility with alias \"FORT SIMPSON CLIMATE\" already exists. This alias is discarded.\nREF_6: No value found for the element \"faciliy/responsibleParty/validPeriod\". Information for this item is discarded.\nREF_3: The element \"ObservingFacility/\u2026/programAffiliation\" with WMO306_CD = \"GCOS\" is not linked with any observation under \"observation/programAffilation\", thus it is discarded.\nREF_3: The element \"ObservingFacility/\u2026/programAffiliation\" with WMO306_CD = \"WIGOSnonAffiliated\" is not linked with any observation under \"observation/programAffilation\", thus it is discarded.\n",
    "xmlStatus": "SUCCESS_WITH_WARNINGS",
    "id": 11
}
  1. can the logs property be changed to a list of messages
  2. if not, can the newlines in the logs property be encoded as \\n instead of \n for better pretty printing/readability at least?

Item 1 would be preferred if possible.

@tomkralidis
Copy link
Contributor Author

Moved to wmo-im/wmdr#19

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

No branches or pull requests

1 participant