Crell / ApiProblem

A simple implementation of the api-problem specification. Includes PSR-15 support.
MIT License
239 stars 21 forks source link

Fixes typo #37

Closed Apipa169 closed 3 years ago

Apipa169 commented 3 years ago

This typo results in failures in some scenarios.

Crell commented 3 years ago

I am absolutely fascinated by in what situation this would cause a failure... :sweat_smile:

Apipa169 commented 3 years ago

We have no clue yet. We are using this bundle in multiple apps without having any issues. Today it popped up for some reason.

I’ll dive a bit deeper into it when I have time.

Apipa169 commented 3 years ago

@Crell Will it be possible to tag a release for this fix?

Just fyi, this was the error. It occurs while it was being serialized by the JMS Serializer (4.2.0). We are using doctrine/annotations 1.13.1.

{
    "detail": "[Semantical Error] The annotation \"@autor\" in class Crell\\ApiProblem\\ApiProblem was never imported. Did you maybe forget to add a \"use\" statement for this annotation?",
    "file": "/Users/username/GitHub/project/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php",
    "line": 803
}
Crell commented 3 years ago

I tagged a 3.5.1 release. It should show up in Packagist shortly.

That said, 1) Why are you using JMS Serializer on ApiProblem? I cannot imagine a case where that makes sense. 2) What the heck is JMS Serializer doing that it's choking on an @author tag? I cannot imagine a case where that makes sense.

Apipa169 commented 3 years ago

Thanks for tagging it!

  1. I fully understand why you are asking this. We have some generic functionality we use in multiple places / applications, which uses JMS. To keep it standardized, we decided to use that same functionality. But I totally agree, technically it is not required and a bit devious.
  2. Me neither. It only happened in a specific application, which is not much different from many others.

Just using the asJson() method works, as expected, as a charm.