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

Mapping Saturation and Currentness Request Fail with Validation Error #831

Closed
hn437 opened this issue Oct 9, 2024 · 1 comment · Fixed by #835
Closed

Mapping Saturation and Currentness Request Fail with Validation Error #831

hn437 opened this issue Oct 9, 2024 · 1 comment · Fixed by #835
Assignees
Labels
bug Something isn't working priority:high Should be addressed as soon as possible (next release)

Comments

@hn437
Copy link
Contributor

hn437 commented Oct 9, 2024

Requesting a local setup of OQAPI in Version 1.5 fails with 422 Error: Unprocessable Entity. Tested for mapping saturation and currentness with standard settings. Requests as following:

curl -X 'POST' \
  'http://127.0.0.1:8080/indicators/mapping-saturation' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "bpolys": {
    "type": "FeatureCollection",
    "features": [
      {
        "geometry": {
          "coordinates": [
            [
              [
                8.674092292785645,
                49.40427147224242
              ],
              [
                8.695850372314453,
                49.40427147224242
              ],
              [
                8.695850372314453,
                49.415552187316095
              ],
              [
                8.674092292785645,
                49.415552187316095
              ],
              [
                8.674092292785645,
                49.40427147224242
              ]
            ]
          ],
          "type": "Polygon"
        },
        "type": "Feature"
      }
    ]
  },
  "topic": "building-count",
  "includeFigure": true
}'

Return Body:

{
  "apiVersion": "1.5.0",
  "type": "RequestValidationError",
  "detail": [
    {
      "type": "missing",
      "loc": [
        "body",
        "bpolys",
        "features",
        0,
        "properties"
      ],
      "msg": "Field required",
      "input": {
        "geometry": {
          "coordinates": [
            [
              [
                8.674092292785645,
                49.40427147224242
              ],
              [
                8.695850372314453,
                49.40427147224242
              ],
              [
                8.695850372314453,
                49.415552187316095
              ],
              [
                8.674092292785645,
                49.415552187316095
              ],
              [
                8.674092292785645,
                49.40427147224242
              ]
            ]
          ],
          "type": "Polygon"
        },
        "type": "Feature"
      },
      "url": "https://errors.pydantic.dev/2.8/v/missing"
    }
  ]
}
@hn437 hn437 added bug Something isn't working priority:high Should be addressed as soon as possible (next release) labels Oct 9, 2024
@mcauer
Copy link
Member

mcauer commented Oct 9, 2024

Laut GeoJSON RFC Standard muss jedes Feature ein "properties" Feld haben, das kann dann ein Object oder null sein, im Beispiel fehlt es aber komplett. Darüber beschwert sich die Validator Klasse mit "missing" "Required Field". Evlt. falsche Beispieldaten im Swagger?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority:high Should be addressed as soon as possible (next release)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants