Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
4e27dba
Adding initial set of model interfaces.
mrglavas Oct 11, 2017
36d5d3f
Fixing some imports / references to java.util.Map.
mrglavas Oct 12, 2017
ecadeeb
Adding sub-interfaces for Schema.
mrglavas Oct 16, 2017
4ade267
Factoring out a base interface for extension related methods.
mrglavas Oct 19, 2017
04c9680
Merge pull request #16 from mrglavas/model-merge
arthurdm Oct 24, 2017
e31d9b1
Add OAS factory and resolver
leochr Oct 24, 2017
3580b66
Merge pull request #17 from leochr/new-factory
arthurdm Oct 24, 2017
60f8e65
added docs for Info, License, Contact
janamano Oct 20, 2017
55b8256
added License docs
janamano Oct 24, 2017
826a2f7
Merge pull request #18 from janamanoharan/my_branch_2
arthurdm Oct 24, 2017
ef75620
Updated models javadocs and changed to ref
Oct 24, 2017
b7a6de0
Merge pull request #19 from a-saf/updateModels
arthurdm Oct 24, 2017
0891a54
Updated javadocs for Scopes, OAuthFlow and OAuthFlows
Oct 24, 2017
c1c72bf
Merge branch 'mp-models' of github.com:arthurdm/microprofile-open-api…
Oct 24, 2017
99cde57
Merge pull request #20 from a-saf/updateModels
arthurdm Oct 24, 2017
2bfc4a2
Updating doc
arthurdm Oct 25, 2017
3c6b949
Merge pull request #22 from arthurdm/test
arthurdm Oct 25, 2017
d0b8a41
added docs for responses and RequestBody. Fixed a few things in Info …
janamano Oct 26, 2017
e8f0eb9
Merge pull request #24 from janamanoharan/my_branch_2
arthurdm Oct 26, 2017
df5a028
Updated Server, ServerVariable, and ServerVariables; changed allowabl…
Oct 26, 2017
7a90bec
Merge branch 'mp-models' of github.com:arthurdm/microprofile-open-api…
Oct 26, 2017
219946d
Merge branch 'mp-models' of github.com:arthurdm/microprofile-open-api…
Oct 26, 2017
32b4184
Merge branch 'updateModels' of github.com:a-saf/microprofile-open-api…
Oct 26, 2017
5cdfe10
Update javadoc and check for correctness. 8732
turkeylurkey Oct 19, 2017
7405dbf
Update the Javadocs and remove the Link.headers property because it
turkeylurkey Oct 25, 2017
afd385a
Update the Javadocs. 8732
turkeylurkey Oct 25, 2017
d1a262e
Update the Javadocs and update some model objects. 8732
turkeylurkey Oct 25, 2017
be868bd
Update operations in PathItem to match latest proposal. 8732
turkeylurkey Oct 26, 2017
4b135ea
Update the Javadocs for Discriminator, MediaType, CookieParameter,
turkeylurkey Oct 26, 2017
a6176db
Merge pull request #25 from a-saf/updateModels
arthurdm Oct 26, 2017
c231002
Updated XML model
Oct 27, 2017
129b64b
Merge branch 'mp-models' of github.com:arthurdm/microprofile-open-api…
Oct 27, 2017
fec3036
Merge pull request #28 from a-saf/updateModels
arthurdm Oct 27, 2017
bbe8bac
Adding documentation to the Constructible interface.
mrglavas Oct 30, 2017
053b55f
Merge pull request #29 from mrglavas/construct-docs
mrglavas Oct 30, 2017
ede33c2
Update the Javadocs to be more succinct. 8732
turkeylurkey Oct 31, 2017
070a965
Update the Javadoc in the schema classes. Remove field name methods f…
turkeylurkey Oct 30, 2017
848943d
Merge pull request #26 from turkeylurkey/8732-javadoc
arthurdm Oct 31, 2017
bc35219
Merge pull request #30 from turkeylurkey/8908-schemaJavadoc
mrglavas Oct 31, 2017
198772e
Factor out base interface for 'reference' objects.
mrglavas Oct 31, 2017
9703f43
Merge pull request #31 from mrglavas/reference-interface
mrglavas Oct 31, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@
This specification aims at providing a unified Java API for the OpenAPI v3
specification (https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md),
that all application developers can use to expose their API documentation.

The specification is composed of annotations, models, and configuration interfaces.
30 changes: 30 additions & 0 deletions api/src/main/java/org/eclipse/microprofile/openapi/OASFactory.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* Copyright (c) 2017 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.eclipse.microprofile.openapi;

import org.eclipse.microprofile.openapi.models.Constructible;
import org.eclipse.microprofile.openapi.spi.OASFactoryResolver;

public final class OASFactory {

private static final OASFactoryResolver INSTANCE = OASFactoryResolver.instance();

public static <T extends Constructible> T createObject(Class<T> clazz){
return INSTANCE.createObject(clazz);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -44,33 +44,33 @@

/**
* The Content-Type for encoding a specific property.
* Default value depends on the property type:
* i.e. for binary string - contentType is application/octet-stream, for primitive types - text/plain, for object - application/json.
**/
String contentType() default "";

/**
* Describes how a specific property value will be serialized depending on its type
**/
* Style describes how the encoding value will be serialized depending on the type of the parameter value.
**/
String style() default "";

/**
*
* When this is true, property values of type array or object generate separate parameters for each value of the array,
* or key-value-pair of the map.
*
* For other types of properties this property has no effect. When style is form, the default value is true.
* For all other styles, the default value is false.
**/
boolean explode() default false;

/**
*
* Determines whether the parameter value SHOULD allow reserved characters,
* as defined by RFC3986 :/?#[]@!$&'()*+,;= to be included without percent-encoding.
*
* as defined by RFC3986 to be included without percent-encoding.
* @see RFC3986 for full definition of reserved characters
**/
boolean allowReserved() default false;

/**
* An array of header objects
*
* Headers property of an Encoding is a map that allows additional information to be provided as headers.
*/
Header[] headers() default {};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,11 @@
String type() default "";

/**
* Provides a list of allowable values. This field map to the enum property in the OAS schema.
* Provides a list of enum values. This field maps to the enum property in the OAS schema
* and the enumeration property in the corresponding model.
* @return a list of allowed schema values
*/
String[] allowableValues() default {};
String[] enumeration() default {};

/**
* Provides a default value.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

/**
* Represents an OAuth scope.
* @see "https://github.com/OAI/OpenAPI-Specification/blob/3.0.0-rc2/versions/3.0.md#oauthFlowsObject"
**/
@Target({ })
@Retention(RetentionPolicy.RUNTIME)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
String name();

/**
* If the security scheme is of type "oauth2" or "openIdConnect", then the value is a list of scope names required for the execution. For other security scheme types, the array must be empty.
* If the security scheme is of type "oauth2" or "openIdConnect", then the value is a list of scope names required for the execution.
* For other security scheme types, the array MUST be empty.
*/
String[] scopes() default {};
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,17 @@


/**
* Defines a security scheme that can be used by the operations. Supported schemes are HTTP authentication, an API key (either as a header or as a query parameter), OAuth2's common flows (implicit, password, application and access code) as defined in RFC6749, and OpenID Connect Discovery.
* Defines a security scheme that can be used by the operations.
* Supported schemes are HTTP authentication, an API key (either as a header or as a query parameter), OAuth2's common flows (implicit, password, application and access code) as defined in RFC6749, and OpenID Connect Discovery.
**/
@Target({ ElementType.METHOD,
ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
@Inherited
public @interface SecurityScheme {
/**
* Type is a REQUIRED property that specifies the type of SecurityScheme instance.
* <p>
* The type of the security scheme. Valid values are "apiKey", "http", "oauth2", "openIdConnect".
**/
String type();
Expand All @@ -43,33 +46,40 @@
String description() default "";

/**
* The name of the header or query parameter to be used. Applies to apiKey type.
* Name is a REQUIRED property for apiKey type. It is the name of the header, query or cookie parameter to be used.
* Applies to apiKey type.
**/
String name() default "";

/**
* The location of the API key. Valid values are "query" or "header". Applies to apiKey type.
* The location of the API key. Valid values are "query" or "header".
* A REQUIRED property for apiKey type.
**/
String in() default "";

/**
* The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC 7235. Applies to http type.
* The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC 7235.
* A REQUIRED property for http type.
**/
String scheme() default "";

/**
* A hint to the client to identify how the bearer token is formatted. Bearer tokens are usually generated by an
* authorization server, so this information is primarily for documentation purposes. Applies to http ("bearer") type.
* A hint to the client to identify how the bearer token is formatted.
* Bearer tokens are usually generated by an authorization server, so this information is primarily for documentation purposes.
* Applies to http ("bearer") type.
**/
String bearerFormat() default "";

/**
* Required. An object containing configuration information for the flow types supported. Applies to oauth2 type.
* This is a REQUIRED property for oauth2 type.
* An object containing configuration information for the flow types supported.
**/
OAuthFlows flows() default @OAuthFlows;

/**
* Required. OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the form of a URL. Applies to openIdConnect.
* This is a REQUIRED property for openIdConnect type.
* OpenId Connect URL to discover OAuth2 configuration values.
* This MUST be in the form of a URL.
**/
String openIdConnectUrl() default "";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,16 @@
@Inherited
public @interface Server {
/**
* Required. A URL to the target host. This URL supports Server Variables and may be relative, to indicate that the host location is relative to the location where the OpenAPI definition is being served. Variable substitutions will be made when a variable is named in {brackets}.
* A URL to the target host.
* This URL supports Server Variables and may be relative, to indicate that the host location is relative to the location where the OpenAPI definition is being served.
* Variable substitutions will be made when a variable is named in {brackets}.
* This is a REQUIRED property.
**/
String url() default "";

/**
* An optional string describing the host designated by the URL. CommonMark syntax MAY be used for rich text representation.
* An optional string describing the host designated by the URL.
* CommonMark syntax MAY be used for rich text representation.
**/
String description() default "";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,24 @@
@Inherited
public @interface ServerVariable {
/**
* Required. The name of this variable.
* The name of this server variable. This is a REQUIRED property.
**/
String name();

/**
* An array of allowable values for this variable. This field map to the enum property in the OAS schema.
* An array of enum values for this variable. This field maps to the enum property in the OAS schema
* and to enumeration field of ServerVariable model.
**/
String[] allowableValues() default "";
String[] enumeration() default "";

/**
* Required. The default value of this variable.
* The default value of this server variable. This is a REQUIRED property.
**/
String defaultValue();

/**
* An optional description for the server variable.
* An optional description for the server variable.
* CommonMark syntax can be used for rich text representation.
**/
String description() default "";

Expand Down
Loading