Skip to content

Commit

Permalink
Switch annotation/attribute tab order to make showing attributes the …
Browse files Browse the repository at this point in the history
…default (#1587)
  • Loading branch information
DerManoMann authored May 2, 2024
1 parent 520ffb7 commit d7a9c21
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 44 deletions.
6 changes: 3 additions & 3 deletions docs/.vitepress/theme/components/Codeblock.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<template>
<div>
<tabs :options="{ useUrlFragment: false }">
<tab :id="anId" name="Annotations">
<slot name="an"></slot>
</tab>
<tab :id="atId" name="Attributes">
<slot name="at"></slot>
</tab>
<tab :id="anId" name="Annotations">
<slot name="an"></slot>
</tab>
</tabs>
</div>
</template>
Expand Down
10 changes: 5 additions & 5 deletions docs/guide/cookbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,17 +278,17 @@ Form posts are `@OA\Post` requests with a `multipart/form-data` `@OA\RequestBody
Unless specified each endpoint needs to declare what security schemes it supports. However, there is a way
to also configure security schemes globally for the whole API.

This is done on the `@OA\OpenApi` annotations:
This is done on the `@OA\OpenApi` annotation:

<codeblock id="minimal">
<template v-slot:an>
<template v-slot:at>

<<< @/snippets/guide/cookbook/default_security_an.php
<<< @/snippets/guide/cookbook/default_security_at.php

</template>
<template v-slot:at>
<template v-slot:an>

<<< @/snippets/guide/cookbook/default_security_at.php
<<< @/snippets/guide/cookbook/default_security_an.php

</template>
</codeblock>
Expand Down
10 changes: 5 additions & 5 deletions docs/guide/required-elements.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ The endpoint, in turn, needs to have a path and at least one response.

## Minimum required annotations

With the above in mind a minimal API with a single endpoint could look like this
With the above in mind a minimal API with a single endpoint could look like this:

<codeblock id="minimal">
<template v-slot:an>
<template v-slot:at>

<<< @/snippets/minimal_api_an.php
<<< @/snippets/minimal_api_at.php

</template>
<template v-slot:at>
<template v-slot:an>

<<< @/snippets/minimal_api_at.php
<<< @/snippets/minimal_api_an.php

</template>
</codeblock>
Expand Down
10 changes: 5 additions & 5 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ features:

### 2. Update your code

Add `swagger-php` annotations or attributes to your source code.
Add `swagger-php` attributes or annotations to your source code.

<codeblock id="minimal">
<template v-slot:an>
<template v-slot:at>

<<< @/snippets/minimal_api_an.php
<<< @/snippets/minimal_api_at.php

</template>
<template v-slot:at>
<template v-slot:an>

<<< @/snippets/minimal_api_at.php
<<< @/snippets/minimal_api_an.php

</template>
</codeblock>
Expand Down
21 changes: 0 additions & 21 deletions docs/snippets/example_annotations.php

This file was deleted.

2 changes: 1 addition & 1 deletion docs/snippets/guide/cookbook/default_security_an.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
* scheme="bearer"
* )
*/
class OpenApi
class OpenApiSpec
{
}
4 changes: 0 additions & 4 deletions docs/snippets/minimal_api_at.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,3 @@ public function getResource()
// ...
}
}

class OpenApiSpec
{
}

0 comments on commit d7a9c21

Please sign in to comment.