Skip to content
This repository was archived by the owner on Apr 28, 2026. It is now read-only.
This repository was archived by the owner on Apr 28, 2026. It is now read-only.

Allow spaces in collection names #31

Description

@BrunoRoemers

Expected Behavior

ODM can handle spaces in collection ids. The official restrictions on collection ids are documented here: https://firebase.google.com/docs/firestore/quotas#limits

Actual Behavior

ODM refuses to generate code when a collection id containing a space is passed to @Collection().

Relevant LOCs: https://github.com/FirebaseExtended/firestoreodm-flutter/blob/main/packages/cloud_firestore_odm_generator/lib/src/collection_data.dart#L341

Unfortunately we have a few collections with spaces in their names, which blocks us from fully adopting the Cloud Firestore ODM.

Hacky Workaround

  1. Temporarily remove the space of the collection name; i.e. @Collection('hello world') becomes @Collection('helloworld')
  2. Run code generator (works)
  3. Edit the generated file; add the space again

This is a maintenance nightmare though.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions