<commit_before>package com.avsystem.commons
package rest

import com.avsystem.commons.rpc._

@methodTag[RestMethodTag, Prefix]
@paramTag[RestParamTag, JsonBodyParam]
case class RestMetadata[T](
  @multi @tagged[Prefix] prefixMethods: Map[String, PrefixMetadata[_]],
  @multi @tagged[HttpMethodTag] httpMethods: Map[String, HttpMethodMetadata[_]]
) {
  def ensureUnambiguousPaths(): Unit = {
    val trie = new RestMetadata.Trie
    trie.fillWith(this)
    trie.mergeWildcardToNamed()
    val ambiguities = new MListBuffer[(String, List[String])]
    trie.collectAmbiguousCalls(ambiguities)
    if (ambiguities.nonEmpty) {
      val problems = ambiguities.map { case (path, chains) =>
        s"$path may result from multiple calls:\n  ${chains.mkString("\n  ")}"<commit_msg>fixed definition of RestMetadata to have correct default param tags<commit_after>package com.avsystem.commons
package rest

import com.avsystem.commons.rpc._

@methodTag[RestMethodTag, Prefix]
case class RestMetadata[T](
  @paramTag[RestParamTag, Path] @multi @tagged[Prefix]
  prefixMethods: Map[String, PrefixMetadata[_]],
  @paramTag[RestParamTag, Query] @multi @tagged[GET]
  httpGetMethods: Map[String, HttpMethodMetadata[_]],
  @paramTag[RestParamTag, JsonBodyParam] @multi @tagged[BodyMethodTag]
  httpBodyMethods: Map[String, HttpMethodMetadata[_]]
) {
  val httpMethods: Map[String, HttpMethodMetadata[_]] =
    httpGetMethods ++ httpBodyMethods

  def ensureUnambiguousPaths(): Unit = {
    val trie = new RestMetadata.Trie
    trie.fillWith(this)
    trie.mergeWildcardToNamed()
    val ambiguities = new MListBuffer[(String, List[String])]
    trie.collectAmbiguousCalls(ambiguities)
    if (ambiguities.nonEmpty) {
      val problems = ambiguities.map { case (path, chains) =>
        s"$path may result from multiple calls:\n  ${chains.mkString("\n  ")}"
{'fraction_non_alphanumeric': 0.11617806731813246, 'fraction_numerical': 0.0, 'mean_word_length': 5.2687074829931975, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '3022066', 'n_tokens_mistral': 584, 'n_tokens_neox': 565, 'n_words': 130}