Skip to content

Commit

Permalink
Add summary attribute to Info
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamin-confino committed Apr 26, 2024
1 parent 8164b10 commit 92a99a7
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 4 deletions.
Expand Up @@ -75,6 +75,13 @@
**/
String version();

/**
* The summary of the API.
*
* @return the summary for the API
**/
String summary() default "";

/**
* List of extensions to be added to the {@link org.eclipse.microprofile.openapi.models.info.Info Info} model
* corresponding to the containing annotation.
Expand Down
Expand Up @@ -34,6 +34,6 @@
* </pre>
*/

@org.osgi.annotation.versioning.Version("1.1")
@org.osgi.annotation.versioning.Version("1.2")
@org.osgi.annotation.versioning.ProviderType
package org.eclipse.microprofile.openapi.annotations.info;
Expand Up @@ -200,4 +200,31 @@ default Info version(String version) {
return this;
}

/**
* Returns the summary of the exposed API from this Info instance.
*
* @return the summary of the exposed API
**/
String getSummary();

/**
* Sets this Info instance's summary information for the exposed API.
*
* @param summary
* the summary of the exposed API
*/
void setSummary(String summary);

/**
* Sets this Info instance's summary of the API to the given summary and returns this instance of Info.
*
* @param summary
* the summary for the exposed API
* @return this Info instance
*/
default Info summary(String summary) {
setSummary(summary);
return this;
}

}
Expand Up @@ -40,6 +40,6 @@
* </pre>
*/

@org.osgi.annotation.versioning.Version("1.0")
@org.osgi.annotation.versioning.Version("1.1")
@org.osgi.annotation.versioning.ProviderType
package org.eclipse.microprofile.openapi.models.info;
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2017 Contributors to the Eclipse Foundation
* Copyright (c) 2017, 2024 Contributors to the Eclipse Foundation
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a
* copy of the License at
Expand Down Expand Up @@ -38,7 +38,8 @@
url = "http://www.apache.org/licenses/LICENSE-2.0.html"),
contact = @Contact(name = "PetStore API Support",
url = "https://github.com/eclipse/microprofile-open-api",
email = "support@petstore.com")),
email = "support@petstore.com"),
summary = "An API for a pet store"),
externalDocs = @ExternalDocumentation(url = "http://swagger.io",
description = "Find out more about our store"),
tags = {
Expand Down

0 comments on commit 92a99a7

Please sign in to comment.