Skip to content

REST API for Puli Resources provided through the CmfResourceBundle

Notifications You must be signed in to change notification settings

mkoniarz/resource-rest-bundle

 
 

Repository files navigation

Symfony CMF Resource REST API Bundle

Build Status StyleCI Latest Stable Version Total Downloads

This Bundle provides a REST API to Puli resources as provided by the CmfResource component.

Requirements

Documentation

Not yet.

Example

$ curl http://localhost:8000/api/phpcrodm_repo/foo | python -m json.tool
{
    "_links": {
        "self": {
            "href": "/api/phpcrodm_repo/foo"
        }
    },
    "children": {
        "bar": {
            "_links": {
                "self": {
                    "href": "/api/phpcrodm_repo/foo/bar"
                }
            },
            "children": [],
            "document": {
                "_links": {
                    "self": {
                        "href": "/path/to/this"
                    }
                },
                "body": "This is my second article",
                "id": "/tests/cmf/articles/foo/bar",
                "title": "Article 2"
            },
            "path": "/foo/bar",
            "repo_path": "/foo/bar"
        },
        "boo": {
            "_links": {
                "self": {
                    "href": "/api/phpcrodm_repo/foo/boo"
                }
            },
            "children": [],
            "document": {
                "_links": {
                    "self": {
                        "href": "/path/to/this"
                    }
                },
                "body": "This is my third article",
                "id": "/tests/cmf/articles/foo/boo",
                "title": "Article 2"
            },
            "path": "/foo/boo",
            "repo_path": "/foo/boo"
        }
    },
    "document": {
        "_links": {
            "self": {
                "href": "/path/to/this"
            }
        },
        "body": "This is my article",
        "id": "/tests/cmf/articles/foo",
        "title": "Article 1"
    },
    "path": "/foo",
    "repo_path": "/foo"
}

Contributing

Pull requests are welcome. Please see our CONTRIBUTING guide.

Unit and/or functional tests exist for this bundle. See the Testing documentation for a guide to running the tests.

Thanks to everyone who has contributed already.

Running the tests

Behat

  • Setup database: ./vendor/symfony-cmf/testing/bin/travis/phpcr_odm_doctrine_dbal.sh
  • Run server: ./vendor/symfony-cmf/testing/bin/server
  • Run tests: ./vendor/bin/behat

About

REST API for Puli Resources provided through the CmfResourceBundle

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 77.2%
  • Gherkin 22.8%