Snapshot: Parsing Error at path []: Snapshots must be configured with a 'strategy', 'unique_key', and 'target_schema'

In dbt-core, I have created a folder under snapshots called salesforce. All my snapshot sqls are in this folder. Now I have a few common configs that I have added in dbt_project.yml given below:

snapshots:
  salesforce:
    +unique_key: id
    +target_schema: snapshots
    +invalidate_hard_deletes: True

And the remaining configs in my respective sqls in config:

{{
    config(
      strategy='timestamp',
      updated_at='SYSTEM_MODSTAMP',
    )
}}

However, when I run dbt snapshot command with this setup, I get the following error:
Parsing Error
at path : Snapshots must be configured with a ‘strategy’, ‘unique_key’, and ‘target_schema’.

When I dont create the salseforce folder under snapshot and add all my sqls directly under snapshot with following configuration it works.

snapshots:
   +unique_key: id
   +target_schema: snapshots
   +invalidate_hard_deletes: True

What am I missing?

I think the problem is that you are missing the project name. In your dbt_project.yml file, there should be a line saying:
name: 'data_platform' (or whatever you have called your project).
Now try modifying your snapshot configuration:

snapshots:
  data_platform:
    salesforce:
      +unique_key: id
      +target_schema: snapshots
      +invalidate_hard_deletes: True