<commit_before>import {Schema} from 'swagger-schema-official';
import {IOperationExtended} from '../interfaces/IOperationExtended';

export function schema(operation: IOperationExtended) {
  for (const code in operation.responses) {
    if (operation.responses.hasOwnProperty(code)) {
      const response = operation.responses[code];

      if (response.schema) {
        return response.schema;
      }
    }
  }
}

export function value(schemaObject: Schema): any {
  if (schemaObject.example) {
    return schemaObject.example;
  }

  const typeValue = schemaObject.format || schemaObject.type || (schemaObject.enum ? 'enum' : null);

  switch (typeValue) {
    case 'int32':
    case 'int64':
    case 'integer':
      return 0;
    case 'float':
    case 'double':
    case 'number':
      return 0.5;
    case 'string':
      return 'string';
    case 'byte':
      return btoa('string');<commit_msg>schema<commit_after>import {Schema} from 'swagger-schema-official';
import {IOperationExtended} from '../interfaces/IOperationExtended';

export function schema(operation: IOperationExtended) {
  for (const code in operation.responses) {
    if (operation.responses.hasOwnProperty(code)) {
      const response = operation.responses[code];

      if (response.schema) {
        return response.schema;
      }
    }
  }
}

export function value(schemaObject: Schema): any {
  if (schemaObject.example) {
    return schemaObject.example;
  }

  const typeValue = schemaObject.format || schemaObject.type || (schemaObject.enum ? 'enum' : null);

  switch (typeValue) {
    case 'int32':
    case 'int64':
    case 'integer':
      return 0;
    case 'float':
    case 'double':
    case 'number':
      return 0.5;
    case 'string':
      return schemaObject.enum ? schemaObject.enum[0] : 'string';
    case 'byte':
      return btoa('string');
{'fraction_non_alphanumeric': 0.1264864864864865, 'fraction_numerical': 0.008108108108108109, 'mean_word_length': 3.2551724137931033, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4130314', 'n_tokens_mistral': 564, 'n_tokens_neox': 547, 'n_words': 137}