Record Class ContractModel

java.lang.Object
java.lang.Record
com.arc_e_tect.gradle.apionly.transcriberj.model.ContractModel
Record Components:
openapi - openapi, the specification version
title - the OpenAPI document's info.title, or null
asyncTitle - the AsyncAPI document's own info.title, or null when the contract has no AsyncAPI document, or that document gives none; Microcks imports an AsyncAPI-described service under this title, not title, so a tool matching an imported service to this contract needs this one instead
version - info.version, the contract's own version, or null
components - the schema components, in declaration order
responses - the reusable response components, in declaration order
parameters - the reusable parameter components, in declaration order
requestBodies - the reusable request body components, in declaration order
otherComponents - components of every other type -- security schemes, headers and the like -- keyed by type, as parsed
examples - the Example Objects under components.examples, by name, as parsed: what an example given as a reference refers to
paths - the path items, in declaration order
channels - the channels of the contract's AsyncAPI document, in declaration order; empty when it has none
asyncOperations - the operations of that document, in declaration order
findings - every classified construct, in the order it was found

public record ContractModel(String openapi, String title, String asyncTitle, String version, List<Component> components, List<Reusable<Response>> responses, List<Reusable<Parameter>> parameters, List<Reusable<RequestBody>> requestBodies, Map<String,Object> otherComponents, Map<String,Object> examples, List<PathItem> paths, List<AsyncChannel> channels, List<AsyncOperation> asyncOperations, List<Finding> findings) extends Record
A bundled contract, in the terms code generation needs: its OpenAPI document, and its AsyncAPI document where it has one, as one model.
  • Constructor Details

  • Method Details

    • component

      public Optional<Component> component(String name)
      The schema component with the given name.
      Parameters:
      name - its key under components.schemas
      Returns:
      the component, or empty when there is none
    • operations

      public List<Operation> operations()
      Every operation, path by path, in declaration order.
      Returns:
      the operations
    • messages

      public List<AsyncMessage> messages()
      The messages of every channel, in declaration order.
      Returns:
      the messages
    • operation

      public Optional<Operation> operation(String operationId)
      The operation with the given operationId.
      Parameters:
      operationId - the id
      Returns:
      the operation, or empty when there is none
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • openapi

      public String openapi()
      Returns the value of the openapi record component.
      Returns:
      the value of the openapi record component
    • title

      public String title()
      Returns the value of the title record component.
      Returns:
      the value of the title record component
    • asyncTitle

      public String asyncTitle()
      Returns the value of the asyncTitle record component.
      Returns:
      the value of the asyncTitle record component
    • version

      public String version()
      Returns the value of the version record component.
      Returns:
      the value of the version record component
    • components

      public List<Component> components()
      Returns the value of the components record component.
      Returns:
      the value of the components record component
    • responses

      public List<Reusable<Response>> responses()
      Returns the value of the responses record component.
      Returns:
      the value of the responses record component
    • parameters

      public List<Reusable<Parameter>> parameters()
      Returns the value of the parameters record component.
      Returns:
      the value of the parameters record component
    • requestBodies

      public List<Reusable<RequestBody>> requestBodies()
      Returns the value of the requestBodies record component.
      Returns:
      the value of the requestBodies record component
    • otherComponents

      public Map<String,Object> otherComponents()
      Returns the value of the otherComponents record component.
      Returns:
      the value of the otherComponents record component
    • examples

      public Map<String,Object> examples()
      Returns the value of the examples record component.
      Returns:
      the value of the examples record component
    • paths

      public List<PathItem> paths()
      Returns the value of the paths record component.
      Returns:
      the value of the paths record component
    • channels

      public List<AsyncChannel> channels()
      Returns the value of the channels record component.
      Returns:
      the value of the channels record component
    • asyncOperations

      public List<AsyncOperation> asyncOperations()
      Returns the value of the asyncOperations record component.
      Returns:
      the value of the asyncOperations record component
    • findings

      public List<Finding> findings()
      Returns the value of the findings record component.
      Returns:
      the value of the findings record component