| 1 |
<div class="wrap"> |
| 2 |
<h2><?php echo esc_html( $page_title ); ?></h2> |
| 3 |
<form action="" method="post"> |
| 4 |
<?php wp_nonce_field( 'swagger_api_setting' ) ?> |
| 5 |
<table class="form-table"> |
| 6 |
<tbody> |
| 7 |
<tr> |
| 8 |
<th>API Basepath</th> |
| 9 |
<td> |
| 10 |
<select name="swagger_api_basepath"> |
| 11 |
<?php |
| 12 |
foreach ( $namespaces as $namespace ) { |
| 13 |
?> |
| 14 |
<option value="<?php echo esc_attr( $namespace ); ?>" <?php selected( $namespace, $swagger_api_basepath ) ?>><?php echo esc_html( $namespace ); ?></option> |
| 15 |
<?php |
| 16 |
} |
| 17 |
?> |
| 18 |
</select> |
| 19 |
</td> |
| 20 |
</tr> |
| 21 |
<tr> |
| 22 |
<th>Authentication</th> |
| 23 |
<td> |
| 24 |
<label> |
| 25 |
<input type="checkbox" name="swagger_api_auth_schemes[]" value="basic" <?php checked( in_array( 'basic', $swagger_api_auth_schemes, true ) ); ?>> |
| 26 |
Basic |
| 27 |
</label><br> |
| 28 |
<label> |
| 29 |
<input type="checkbox" name="swagger_api_auth_schemes[]" value="bearer" <?php checked( in_array( 'bearer', $swagger_api_auth_schemes, true ) ); ?>> |
| 30 |
Bearer (Authorization header) |
| 31 |
</label> |
| 32 |
<p class="description">Which authentication methods appear in the Swagger UI Authorize dialog. Bearer requires a token plugin (e.g. JWT) installed to validate requests.</p> |
| 33 |
</td> |
| 34 |
</tr> |
| 35 |
<tr> |
| 36 |
<th>OpenAPI Version</th> |
| 37 |
<td> |
| 38 |
<select name="swagger_api_spec_version"> |
| 39 |
<?php |
| 40 |
foreach ( $spec_versions as $version ) { |
| 41 |
?> |
| 42 |
<option value="<?php echo esc_attr( $version ); ?>" <?php selected( $version, $swagger_api_spec_version ); ?>><?php echo esc_html( $version ); ?></option> |
| 43 |
<?php |
| 44 |
} |
| 45 |
?> |
| 46 |
</select> |
| 47 |
<p class="description">Schema output format. 2.0 = Swagger 2.0; 3.0.3 = OpenAPI 3.0.3.</p> |
| 48 |
</td> |
| 49 |
</tr> |
| 50 |
<tr> |
| 51 |
<th>Contact Email</th> |
| 52 |
<td> |
| 53 |
<label> |
| 54 |
<input type="checkbox" name="swagger_api_expose_contact_email" value="1" <?php checked( '1', $swagger_api_expose_contact_email ); ?>> |
| 55 |
Include the site admin email as the API contact in the schema |
| 56 |
</label> |
| 57 |
<p class="description">Uncheck to omit <code>contact.email</code> from the public schema. Developers can still override via the <code>swagger_api_contact_email</code> filter.</p> |
| 58 |
</td> |
| 59 |
</tr> |
| 60 |
<tr> |
| 61 |
<th>API Docs</th> |
| 62 |
<td> |
| 63 |
<a href="<?php echo esc_url( $docs_url ); ?>" target="__blank">Docs URL</a> |
| 64 |
</td> |
| 65 |
</tr> |
| 66 |
</tbody> |
| 67 |
</table> |
| 68 |
<?php submit_button(); ?> |
| 69 |
</form> |
| 70 |
</div> |