Skip to content

Commit

Permalink
Update readme with a backed enum example instead of an array
Browse files Browse the repository at this point in the history
  • Loading branch information
uderline committed Apr 8, 2023
1 parent 5bb021f commit da61996
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ A new file called `openapi.json` has been generated !
class Controller {
#[
GET("/path/{id}", ["Tag1", "Tag2"], "Description of the method"),
Property(Type::STRING, "prop1", description: "Property description", enum: ["val1", "val2"]),
Property(Type::STRING, "prop1", description: "Property description", enum: BackedEnum::class),
Property(Type::INT, "prop2", example: 1),
Property(Type::BOOLEAN, "prop3"),
Property(Type::REF, "prop4", ref: RefSchema::class)
Expand All @@ -38,6 +38,12 @@ class Controller {
}
}

enum BackedEnum: string
{
case VAL1: "val1";
case VAL2: "val2";
}

#[
Schema,
Property(Type::STRING, "Property 1"),
Expand Down

0 comments on commit da61996

Please sign in to comment.