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

Path in context file not transformed properly #1260

Closed
SBlechmann opened this issue Nov 1, 2022 · 2 comments
Closed

Path in context file not transformed properly #1260

SBlechmann opened this issue Nov 1, 2022 · 2 comments
Assignees
Labels
bug Something isn't working Low Priority Error Handling

Comments

@SBlechmann
Copy link

SBlechmann commented Nov 1, 2022

Hey there,

I'm using orionld version 1.1.1 and found a small bug while trying to patch an attribute.

In my context file, I have defined my prefix like this:
"myOntology": "https://<myontology.org/schema/"
"myAttr": "myOntology:myAttr"

When I run a Patch towards http://{{orion}}/ngsi-ld/v1/entities//attrs/ I get the following repsonse

{
    "type": "https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound",
    "title": "Entity/Attribute not found",
    "detail": "Entity 'myEntity', Attribute 'myAttr' (https://myOntology=org/schema/myAttr)"
}

So the url is not transformed back properly at this endpoint.

When I hit the request against http://{{orion}}/ngsi-ld/v1/entities//attrs (and adapting the body so that the attribute should get changed properly), the URL gets in fact transformed correctly.

I'm still facing a different error from the used ontology, but at least the url is transformed properly to https://myOntology.org/schema/myAttr

Edit: Seems to just be a wrong print in the error message then.

Thanks for looking into this :)

@kzangeli kzangeli self-assigned this Nov 16, 2022
@kzangeli kzangeli added the bug Something isn't working label Nov 16, 2022
@kzangeli
Copy link
Collaborator

kzangeli commented Nov 16, 2022

Yeah, we discussed this.
The change from dot to equal sign is mandatory before storing keys in mongo (well, dots are prohibited).
So, seems like I messed up and used the "mongo transformed" variable instead of the "original value" variable in the error message.
Not very high on my ToDo but yes, I'll fix it.
Bad errors in the log file is only confusing ...

Thanks for reporting!

@kzangeli kzangeli added the Low Priority Error Handling label Dec 5, 2022
kzangeli added a commit that referenced this issue Jan 9, 2023
kzangeli added a commit that referenced this issue Jan 9, 2023
Issue #1260  Invalid longname of a attribute in error responses
@kzangeli
Copy link
Collaborator

kzangeli commented Jan 9, 2023

Hopefully fixed the issue in PR #1302

@kzangeli kzangeli closed this as completed Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Low Priority Error Handling
Projects
None yet
Development

No branches or pull requests

2 participants