Giter Site home page Giter Site logo

symfony-rest-bundle's People

Contributors

eyjafjallajokull avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

symfony-rest-bundle's Issues

Add command-line generator

  • input entity name, and rest bundle name
  • create controller and service in specified bundle
  • optionally create serializer and validator configs

add Content-Location header

Methods create, update, getSingle should return response with Content-Location header pointing to uniq resource location.

create entity with relations

Hi,

I'm stuck in create case. I've entity with relation. As I saw in example, I can create EntityA with existing EntityB as a relation, but I can't create cascade two entities.

For example POST with payload:

{
   "title": "new",
   "entity_b": {
      "content": "test"
   }
}

dosn't work

but

{
   "title": "new",
   "entity_b_id": 2
}

work

so I cant create comprehensive all entities.

Everything because few lines from RepositoryWrapper:

/**
 * @param $entity
 *
 * @throws BadRequestException
 */
public function assignAssociatedEntities($entity) {
    foreach ($this->metadata->getAssociationMappings() as $association) {
        if (!empty($association['sourceToTargetKeyColumns'])) {
            foreach ($association['sourceToTargetKeyColumns'] as $from => $to) {
                $id = $idValue = $this->metadata->getFieldValue($entity, $from);
                $associatedEntity = $this->manager->getRepository($association['targetEntity'])->find($id);
                if ($associatedEntity === null) {
                    throw new BadRequestException('Related entity id not found', array($from => 'Id not found'));
                }
                $this->metadata->setFieldValue($entity, $association['fieldName'],
                    $this->manager->getReference($association['targetEntity'], $id));
            }
        }
    }
}

so if related ID is null, RepositoryManager is throwing exception.

Any ideas : >?

Filter by related entities

Hello, I'm using your framework and it's fine.

But I want to give support to filter related entities by odata queries.

For example:
/Products?$filter=Categories/Name eq 'food'

Is this feature implemented?

Thx!

WBR

Filters

  • oData format parser. example filters:
    • name eq 'lucifer'
    • price lt 100
    • price gt 111.11 and price lt 222.22 (at this stage implement only "and" logical operator)
  • validate field names
  • by default all fields are "filterable"
  • limit filterable fields with config parameter
  • handle custom field names

Autogenerated documentation

Generate documentation using doctrine, serializer and validator config files.

  • pretty-swagger-like-html
  • swagger json
  • are there any other rest describing formats?

Collection ordering

  • support sort query param, examples
    • price desc
    • name asc, price desc
  • configurable default order
  • configurable fields for ordering

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.