//
//= Swagger base schema

// Panels
.swagger-panel-operation {
  &-get {
    //@include swagger-panel-operation(#e7f6ec);
  }
  &-get {
    //@include swagger-panel-operation(#e7f0f7);
  }
  &-put {
    //@include swagger-panel-operation(#f9f2e9);
  }
  &-patch {
    //@include swagger-panel-operation(#FCE9E3);
  }
  &-options {
    //@include swagger-panel-operation(#e7f0f7);
  }
  &-delete {
    //@include swagger-panel-operation(#f5e8e8);
  }
  &-head {
    //@include swagger-panel-operation(#fcffcd);
  }
}

.swagger-operation-path {
  @include named-section($msg-swagger-section-operation-path);
}

.swagger-operation-description {
  @include named-section($msg-swagger-section-operation-description);
}

.swagger-request-params {
  @include named-section($msg-swagger-section-request-params);
}

.swagger-request-body {
  @include named-section($msg-swagger-section-request-body);

  .json-schema-properties:before {
    display: none;
  }
}

.swagger-responses {
  @include named-section($msg-swagger-section-responses);
}

.swagger-global {
  @include named-label($msg-swagger-badge-global);
}


// Tables
table.table {

  th.swagger-param-key {
    @include table-header($msg-swagger-param-key, 10%);
  }
  th.swagger-param-name {
    @include table-header($msg-swagger-param-name, 10%);
  }
  th.swagger-param-description {
    @include table-header($msg-swagger-param-description);
  }
  th.swagger-param-data-type {
    @include table-header($msg-swagger-param-data-type, 30%);
  }
  th.swagger-param-type {
    @include table-header($msg-swagger-param-type, 10%);
  }

  th.swagger-request-security-schema {
    @include table-header($msg-swagger-request-security-schema, 50%);
  }
  th.swagger-request-security-scopes {
    @include table-header($msg-swagger-request-security-scopes, 50%);
  }

  // Response headers
  th.swagger-response-header-name {
    @include table-header($msg-swagger-response-header-name)
  }

  th.swagger-response-header-description {
    @include table-header($msg-swagger-response-header-description)
  }

  th.swagger-response-header-data-type {
    @include table-header($msg-swagger-response-header-data-type)
  }

  // Response table
  th.swagger-response-code {
    @include table-header($msg-swagger-response-code)
  }

  th.swagger-response-description {
    @include table-header($msg-swagger-response-description)
  }

  th.swagger-response-schema {
    @include table-header($msg-swagger-response-schema)
  }
}
.swagger-response-name-value {
  font-weight: bold;
}

.swagger-param-collection-format {
}

.swagger-response-description-text {
  padding-bottom: 0.5em;
}

.swagger-request-security {
  @include named-section($msg-swagger-section-request-security);
}

.swagger-security-definition-properties {
  // @include named-section($msg-swagger-security-definition-properties);
}

.swagger-security-definition {
  &-basic {
    &:before {
      color: $medium-gray;
      content: $msg-swagger-security-definition-type-basic;
    }
  }
  &-oauth2 {
    &:before {
      color: $medium-gray;
      content: $msg-swagger-security-definition-type-oauth2;
    }
  }
  &-apiKey {
    &:before {
      color: $medium-gray;
      content: $msg-swagger-security-definition-type-apikey;
    }
  }
}

//
//= Swagger JSON schema

.json-schema-description {
  @include named-section($msg-json-section-description);
}

.json-schema-properties {
  @include named-section($msg-json-section-properties);

  dd {
    color: $dark-gray;
  }
  dd:not(:last-child) {
    padding-bottom: 0.75rem;
  }

  dl {
    margin: 0;
  }
}

.json-schema-description + .json-schema-properties {
    margin-top: 1.5rem;
}

.json-schema-ref-array {
  &:before {
    color: $dark-gray;
    content: "Array<";
  }
  &:after {
    color: $dark-gray;
    content: ">";
  }
}

.json-schema-example {
  @include named-section($msg-json-section-example);
}

.json-schema-array-items {
  @include named-section($msg-json-section-items);
}

.json-schema-allOf-inherited {
  @include named-section($msg-json-section-inherited);
}

.json-schema-anyOf {
  > dl {
    padding-left: 1em;
    dt:not(:first-child):before {
      content: "or ";
    }
    dt:first-child:before {
      content: "either ";
    }
  }
}

.json-schema-additionalProperties {
  @include named-section($msg-json-section-additionalProperties);
}

.json-inner-schema {
  .json-schema-properties,
  .json-schema-array-items,
  .json-schema-description,
  .json-schema-example {
    padding-left: 1em;
    margin-top: 0.5em;
    padding-bottom: 0.5em;
  }
}

.json-property-discriminator {
  @include named-label($msg-json-discriminator)
}

.json-property-required {
  @include named-label($msg-json-required)
}

.json-property-read-only {
  @include named-label($msg-json-read-only)
}


.json-property-type {
  font-style: italic;
  font-weight: 100;
}

.json-property-format {
  font-size: smaller;
}

.json-property-enum {
  font-weight: lighter;
  font-size: small;
}

.json-property-default-value {
  font-weight: lighter;
  font-size: small;
  &:before {
    content: '(default: "';
  }
  &:after {
    content: '")';
  }
}

.json-property-enum-item {
  &:before, &:after {
    content: "\""
  }
  font-weight: lighter;
  font-size: small;

}

.json-schema-reference {
  font-size: 90%;
}
