Example #1
0
 /**
  * test schema
  *
  * @return void
  */
 public function testAddSchema()
 {
     $endpoint = "test/schema/endpoint";
     $testschema = new \stdClass();
     $testschema->name = "test123";
     $testschema->description = "This is a description";
     $sut = new ApiDefinition();
     $sut->addSchema($endpoint, $testschema);
     $schema = $sut->getSchema($endpoint);
     $this->assertInstanceOf("\\stdClass", $schema);
     $this->assertEquals($testschema->name, $schema->name);
     $this->assertEquals($testschema->description, $schema->description);
     $this->assertInstanceOf("\\stdClass", $sut->getSchema("blablabla/endpoint"));
 }
Example #2
0
 /**
  * get a schema for one endpoint
  *
  * @param string $endpoint    endpoint
  * @param bool   $forceReload Switch to force a new api definition object will be provided.
  *
  * @return \stdClass
  */
 public function getEndpointSchema($endpoint, $forceReload = false)
 {
     $this->loadApiDefinition($forceReload);
     return $this->definition->getSchema($endpoint);
 }