question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

shortName on annotated ApiResource

See original GitHub issue

Hi there,

the expected behaviour of the following annotation setting the shortName attribute would be that I should be able to spot “foo_bar” in the entrypoint (“fooBar”: “/foo_bar”), rather than “blurb”, however that doesn’t seem to work as all I can see is “blurb”: “/blurb”…

Is the idea behind shortName still the same as it was in v1?

/**
 * @ApiResource(attributes={"shortName"="FooBar"})
 * @ORM\Entity
 * @ORM\Table(name="doesntreallymatter")
 */
class Blurb {
	...
}

Thanks in advance for your advice!

Kind regards, David

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
djooscommented, Nov 23, 2016

Sorry, scrap my previous reply… #facepalm

Using * @ApiResource(shortName="FooBar") results in having “fooBar”: “/foo_bar” when checking the entrypoint - thanks for your quick feedback! David

1reaction
dunglascommented, Nov 23, 2016

Can you try this:

/**
 * @ApiResource(shortName="FooBar")
 * @ORM\Entity
 * @ORM\Table(name="doesntreallymatter")
 */
class Blurb
{
    // ...
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

how to link http client with ApiResource - Stack Overflow
I have a client which gets xml and converts it to associative array: class GetYukiAccountingBalance implements ...
Read more >
Getting started - API Platform
To expose your entities, you can use Docblock annotations, XML and YAML ... use ApiPlatform\Metadata\ApiResource; use Doctrine\ORM\Mapping as ORM; ...
Read more >
Resource Metadata Factory: Dynamic ApiResource Options
Yep, this ResourceMetadata object contains all of the configuration from our ApiResource annotation... which API Platform then uses to power... pretty much ...
Read more >
Extend the Kubernetes API with CustomResourceDefinitions
Your resource manifests use this. kind: CronTab # shortNames allow ... annotations: kubectl.kubernetes.io/last-applied-configuration: ...
Read more >
Create an API Resource in API Platform | Sajad Torkamani
<?php namespace App\Entity; use ApiPlatform\Core\Annotation\ApiResource; ... {_format} api_jsonld_context ANY ANY ANY /api/contexts/{shortName}.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found