typespec_from_serializers 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0fcb3ccc36429f3897ca0241c3546ae767871bcd3dc7acd51ed396ad9242baf4
4
- data.tar.gz: c005d31f939a5d18cc85c7dc4444e73407c587575646debf673bf272abe8d507
3
+ metadata.gz: 59daa7ce75b192fd0318e7360f7fa9f8f6a91a1b4c2af9de4c7e8f6ccb281cec
4
+ data.tar.gz: e4fc7a830df38e1b2a846acf3ad3f8b233e2d77e339479944c5228901942408c
5
5
  SHA512:
6
- metadata.gz: b35e53c47b2e075eb57e26436ac037d18fe4b2cb2154ed58877e55bc206fe67ee17a253cc78f61d0c8007f7487c8429b6d899332c8b1e7f5686afbd026b080c8
7
- data.tar.gz: ec7c3fa57c006157fefa598c3c129091edd3ac5f35484f46602392a7fbd2b00dc9df2343e776f19cdbc2a98eec64c49d94b6af89e252423c8d401d5bae3a695c
6
+ metadata.gz: dbb851405183db2dd6f633f3ae24a64cf3e3ce164b70ebca97b4af60ba26c4383633c2ddbd46dc381eb0cee5cdb49f66657015857ea6cf90600ff2fe52ba3278
7
+ data.tar.gz: 27db65226501347667a097c87e944122072f6c95f3402990f8ebc078116bdf43252b84aaed61c642c85359a20d1a80e15230c6e7c5a58c44f81b424107a73d30
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # TypeSpec From Serializers Changelog
2
2
 
3
+ ## [0.3.1] - 2025-12-22
4
+
5
+ ### Fixed
6
+ - Fix routes cache key to include documentation field (now uses `inspect` for all fields)
7
+ - Clean up `tsp-output` directory after OpenAPI compilation
8
+ - Make OpenAPI output deterministic by sorting body parameters alphabetically
9
+
10
+ ### Added
11
+ - Tests for cache key invalidation when documentation changes
12
+
3
13
  ## [0.3.0] - 2025-12-20
4
14
 
5
15
  ### Features
@@ -575,7 +575,7 @@ module TypeSpecFromSerializers
575
575
  return [] unless defined?(Rails) && Rails.application
576
576
 
577
577
  routes, controllers = collect_rails_routes
578
- cache_key = routes.map { |r| r.operations.map { |op| "#{op.method}#{r.path}#{op.action}" }.join }.join
578
+ cache_key = routes.map(&:inspect).join
579
579
  write_if_changed(filename: "routes", cache_key: cache_key) {
580
580
  routes_content(routes)
581
581
  }
@@ -770,7 +770,7 @@ module TypeSpecFromSerializers
770
770
  # Internal: Builds body parameters (excludes path params, only for non-GET)
771
771
  def build_body_params(http_method, path_param_names, param_types)
772
772
  return {} if http_method == "GET"
773
- param_types.reject { |key, _| path_param_names.include?(key) }
773
+ param_types.reject { |key, _| path_param_names.include?(key) }.sort.to_h
774
774
  end
775
775
 
776
776
  # Internal: Infers operation response type from route
@@ -49,6 +49,10 @@ module TypeSpecFromSerializers
49
49
  unless config.openapi_path.exist?
50
50
  raise CompilationError, "OpenAPI output not found at: #{config.openapi_path}"
51
51
  end
52
+
53
+ # Clean up TypeSpec's default output directory
54
+ tsp_output = typespec_dir.join("tsp-output")
55
+ FileUtils.rm_rf(tsp_output) if tsp_output.exist?
52
56
  rescue TypeSpecFromSerializers::Runner::MissingExecutableError => e
53
57
  raise CompilationError, <<~ERROR
54
58
  #{e.message}
@@ -2,5 +2,5 @@
2
2
 
3
3
  module TypeSpecFromSerializers
4
4
  # Public: This library adheres to semantic versioning.
5
- VERSION = "0.3.0"
5
+ VERSION = "0.3.1"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: typespec_from_serializers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danila Poyarkov
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2025-12-20 00:00:00.000000000 Z
12
+ date: 2025-12-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties